/* Signup offer: the pop-up that asks for an e-mail address and mails a 10% code.
   The age gate's family: a white card over a dark backdrop, centred. z-index 9050: above the floating contact
   buttons (9000) and the chat (9001), below the cookie modal (9100) and the age gate (9999); dpl-signup-offer.js
   only opens it when both are gone. Mobile first: the panel scrolls inside itself, so the keyboard cannot hide
   the submit button. */

.dpl-signup-offer {
  position: fixed;
  inset: 0;
  z-index: 9050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* display: flex above would otherwise beat the hidden attribute. */
.dpl-signup-offer[hidden] { display: none; }

.dpl-signup-offer:focus { outline: none; }

/* The page behind does not scroll. A class, not an inline style: the age gate and the cookie dialogs each put
   back their own inline overflow when they close. */
body.dpl-signup-offer-open { overflow: hidden; }

/* Empty, so Dawn's `div:empty { display: none }` (base.css) would hide it: no dark page, no click to close. */
.dpl-signup-offer__backdrop,
.dpl-signup-offer__backdrop:empty {
  display: block;
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, 0.55);
  animation: dpl-signup-offer-fade var(--dpl-duration-card) var(--dpl-ease);
}

.dpl-signup-offer__panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 36px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  background: var(--dpl-surface);
  border: 1px solid var(--dpl-border);
  border-radius: var(--dpl-radius-card);
  box-shadow: var(--dpl-shadow-float);
  animation: dpl-signup-offer-rise var(--dpl-duration-card) var(--dpl-ease);
}

@keyframes dpl-signup-offer-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dpl-signup-offer-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dpl-signup-offer__backdrop,
  .dpl-signup-offer__panel { animation: none; }
  .dpl-signup-offer * { transition: none; }
}

/* 44 x 44 px touch target, whatever the icon inside is */
.dpl-signup-offer__close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: var(--dpl-radius-pill);
  color: var(--dpl-text-muted);
  cursor: pointer;
  transition: color var(--dpl-duration-btn) var(--dpl-ease), background-color var(--dpl-duration-btn) var(--dpl-ease);
}

.dpl-signup-offer__close:hover {
  color: var(--dpl-text);
  background: var(--dpl-surface-grey);
}

.dpl-signup-offer__close svg {
  width: 20px;
  height: 20px;
}

.dpl-signup-offer__close:focus-visible,
.dpl-signup-offer__input:focus-visible,
.dpl-signup-offer__optin input:focus-visible,
.dpl-signup-offer__dismiss:focus-visible,
.dpl-signup-offer__fine a:focus-visible {
  outline: 2px solid var(--dpl-accent);
  outline-offset: 2px;
}

.dpl-signup-offer__badge {
  margin: 0;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: var(--dpl-weight-heading);
  letter-spacing: 0.02em;
  color: var(--dpl-text);
  background: var(--dpl-surface-tint);
  border-radius: var(--dpl-radius-pill);
}

.dpl-signup-offer__title {
  margin: 0;
  font-family: var(--dpl-font-heading);
  font-size: 22px;
  font-weight: var(--dpl-weight-heading);
  line-height: 1.25;
  color: var(--dpl-text);
}

.dpl-signup-offer__body {
  margin: 0;
  font-size: var(--dpl-text-size-small);
  line-height: 1.6;
  color: var(--dpl-text-muted);
}

.dpl-signup-offer__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.dpl-signup-offer__form[hidden],
.dpl-signup-offer__success[hidden],
.dpl-signup-offer__dismiss[hidden],
.dpl-signup-offer__error[hidden] { display: none; }

.dpl-signup-offer__label {
  font-size: 12px;
  color: var(--dpl-text-muted);
  letter-spacing: 0.02em;
}

/* 16px stops iOS zooming into the field */
.dpl-signup-offer__input {
  width: 100%;
  box-sizing: border-box;
  min-height: var(--dpl-btn-height);
  padding: 12px 14px;
  font-family: var(--dpl-font-body);
  font-size: 16px;
  color: var(--dpl-text);
  background: var(--dpl-surface-grey);
  border: 1px solid var(--dpl-border);
  border-radius: var(--dpl-radius-input);
}

.dpl-signup-offer__input:focus {
  border-color: var(--dpl-accent);
}

.dpl-signup-offer__input[aria-invalid='true'] {
  border-color: #B3261E;
}

/* The honeypot: off screen, not display: none, which some bots skip. */
.dpl-signup-offer__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dpl-signup-offer__optin {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--dpl-text-muted);
  cursor: pointer;
}

.dpl-signup-offer__optin input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--dpl-accent);
}

.dpl-signup-offer__error {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #B3261E;
}

/* Look and hover: the shared button set in dpl-design-system.css. */
.dpl-signup-offer__submit {
  width: 100%;
}

.dpl-signup-offer__submit[aria-busy='true'] {
  cursor: progress;
  opacity: 0.7;
}

.dpl-signup-offer__success {
  margin: 0;
  padding: 12px 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--dpl-text);
}

/* A text link in a button's box: at least 44px tall to tap */
.dpl-signup-offer__dismiss {
  min-height: 44px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--dpl-text-muted);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

.dpl-signup-offer__dismiss:hover {
  color: var(--dpl-text);
}

.dpl-signup-offer__fine {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--dpl-text-muted);
}

.dpl-signup-offer__fine a {
  color: var(--dpl-text);
  text-decoration: underline;
}

@media screen and (min-width: 750px) {
  .dpl-signup-offer__panel {
    padding: 44px 36px 28px;
    gap: 16px;
  }
  .dpl-signup-offer__close { top: 8px; right: 8px; }
  .dpl-signup-offer__title { font-size: 24px; }
}
