/* =========================================================
   BirthdayNaija: submission forms (modal)
   Uses the same tokens as styles.css. No new colours,
   no new fonts, no new button shapes.
   ========================================================= */

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(17, 17, 17, .55); opacity: 0; transition: opacity .3s var(--ease); }
.modal.is-open .modal__backdrop { opacity: 1; }
.modal__card {
  position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 48px);
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 30px 60px -24px rgba(17, 17, 17, .45);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(24px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
/* Reversing the class (rather than a one-shot @keyframes) is what makes
   the close on mobile mirror the entrance slide instead of just vanishing. */
.modal.is-open .modal__card { opacity: 1; transform: none; }

.modal__close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1;
  color: var(--text-800); background: var(--grey-100); transition: background-color .25s var(--ease), transform .25s var(--ease);
}
.modal__close:hover { background: #e2e2e2; transform: rotate(90deg); }

.modal__head { padding: 26px 28px 18px; border-bottom: 1px solid var(--line); }
.modal__eyebrow { font-weight: 700; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-800); }
.modal__title { margin-top: 8px; font-weight: 700; font-size: 24px; line-height: 1.15; color: var(--ink); padding-right: 28px; }
.modal__sub { margin-top: 8px; font-size: 13px; line-height: 1.55; color: var(--text-800); }
.modal__bar { margin-top: 18px; height: 4px; border-radius: 99px; background: var(--grey-100); overflow: hidden; }
.modal__bar span { display: block; height: 100%; width: 0; border-radius: 99px; background-image: linear-gradient(90deg, var(--g1), var(--g2), var(--g3)); transition: width .45s var(--ease); }

.modal__body { padding: 22px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal__foot { padding: 18px 28px 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.modal__foot [data-m-back] { margin-right: auto; }
.modal__foot[hidden] { display: none; }
.modal__foot .note { flex: 1; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-weight: 600; font-size: 13px; color: var(--ink); }
.field__label span { font-weight: 400; color: var(--text-800); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="date"], .field input[type="number"], .field select, .field textarea {
  width: 100%; padding: 12px 14px; font-family: var(--poppins); font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-m); border-radius: 10px; outline: none;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--g2); box-shadow: 0 0 0 3px rgba(255, 65, 108, .12); }

/* Date input: iOS Safari otherwise ignores width:100% (overflows the card) and
   hides its value. Reset appearance so it fits the frame, keep the mm/dd/yyyy
   placeholder visible, and paint a consistent calendar icon on all browsers. */
.field input[type="date"] {
  position: relative; -webkit-appearance: none; appearance: none;
  min-width: 0; min-height: 46px; box-sizing: border-box; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px 18px;
}
.field input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
/* Native picker button covers the icon area so tapping it opens the calendar */
.field input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute; top: 0; right: 0; width: 42px; height: 100%;
  margin: 0; padding: 0; opacity: 0; cursor: pointer;
}
.field__hint { font-size: 12px; color: var(--text-800); }
.field__error { display: none; font-size: 12px; color: #d92d20; }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: #d92d20; }
.field.is-invalid .field__error { display: block; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- choice cards ---------- */
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line-m); border-radius: 12px; cursor: pointer; transition: border-color .25s var(--ease), background-color .25s var(--ease); }
.opt:hover { border-color: #c9c9c9; }
.opt.is-on { border-color: var(--ink); background: #faf9f8; }
.opt input { margin: 3px 0 0; accent-color: var(--g2); }
.opt__text { display: flex; flex-direction: column; gap: 3px; }
.opt__t { font-weight: 600; font-size: 14px; color: var(--ink); }
.opt__d { font-size: 12px; line-height: 1.5; color: var(--text-800); }
.opt__p { margin-left: auto; padding-left: 10px; font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; }

/* ---------- upload ---------- */
.drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px dashed #cfcfcf; border-radius: 12px; cursor: pointer; transition: border-color .25s var(--ease), background-color .25s var(--ease); }
.drop:hover { border-color: var(--g2); background: #fffafb; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop__thumb { width: 52px; height: 52px; border-radius: 10px; background: var(--grey-100); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; font-size: 18px; }
.drop__thumb img { width: 100%; height: 100%; object-fit: cover; }
.drop__t { display: block; font-weight: 600; font-size: 13px; color: var(--ink); }
.drop__d { display: block; font-size: 12px; color: var(--text-800); margin-top: 2px; }

/* ---------- consent ---------- */
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.55; color: var(--grey-800); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--g2); flex: none; }
.check.is-invalid { color: #d92d20; }

/* ---------- summary ---------- */
.summary { background: #f6f5f2; border: 1px solid var(--line-m); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.summary__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--grey-800); }
.summary__row b { font-weight: 600; color: var(--ink); text-align: right; }
.summary__total { border-top: 1px solid #e3e1dc; padding-top: 10px; font-size: 15px; }
.summary__total b { font-weight: 700; font-size: 16px; }
.note { font-size: 12px; line-height: 1.55; color: var(--text-800); }

/* ---------- paywall: plan chooser at the top of the first form step ----------
   Cards reuse the .plan / .plan__* classes from styles.css (the Figma
   pricing-card spec, built via window.BN_renderPlanCard) so the modal and
   the Plans section on the page render identical cards. This file only
   adds the modal-specific bits: stacking them, the "picked" state, and the
   divider before the actual form fields underneath. */
.paywall__grid { display: flex; flex-direction: column; gap: 16px; margin-bottom: 8px; }
.paywall__grid .plan { width: 100%; }
.paywall__card.is-active { box-shadow: 0 0 0 2px #0f172a inset; }
.paywall__form-title { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); font-weight: 700; font-size: 16px; color: var(--ink); }
.paywall__form-sub { margin-top: 4px; font-size: 13px; color: var(--text-800); }

/* ---------- success ---------- */
.done { padding: 44px 28px 40px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.done__mark { width: 48px; height: 48px; flex: none; }
.done__t { font-weight: 700; font-size: 22px; color: var(--ink); }
.done__d { font-size: 14px; line-height: 1.6; color: var(--text-800); max-width: 380px; }
.done .btn { margin-top: 8px; }

/* ---------- buttons used only in the modal ---------- */
.btn--md { padding: 13px 24px; font-size: 13px; }
.btn--ghost { background: var(--grey-100); color: var(--ink); padding: 13px 22px; font-size: 13px; }
.btn--ghost:hover { background: #e2e2e2; }
.btn[hidden] { display: none; }
body.is-locked { overflow: hidden; }

/* Mobile: the form is its own full-screen page, not a popup card.
   A bottom sheet on a short mobile viewport let the close button and
   header get pushed above the visible screen. This instead takes over
   the whole screen like the hamburger menu, with the cancel/back
   controls pinned so they're always reachable. */
@media (max-width: 767px) {
  .modal { padding: 0; align-items: stretch; }
  .modal__backdrop { display: none; }
  .modal__card {
    max-width: none; width: 100%; height: 100dvh; max-height: 100dvh;
    border-radius: 0; border: 0; box-shadow: none;
    transform: translateX(24px);
  }
  .modal__close {
    top: 14px; right: 14px; z-index: 2;
    width: 38px; height: 38px; font-size: 20px;
    background: var(--grey-100);
  }
  .modal__head { position: sticky; top: 0; z-index: 1; padding: 18px 56px 16px 20px; background: #fff; }
  .modal__title { font-size: 20px; }
  .modal__body { padding: 18px 20px 24px; flex: 1 1 auto; }
  .modal__foot {
    position: sticky; bottom: 0; z-index: 1; background: #fff;
    padding: 14px 20px calc(20px + env(safe-area-inset-bottom)); flex-wrap: wrap;
  }
  .modal__foot .btn { flex: 1; justify-content: center; }
  .row { grid-template-columns: 1fr; }
  .done { padding: 36px 20px; }
}

/* Chosen file shows as an attachment card; the picker hides meanwhile. */
.drop[hidden] { display: none; }
.field .att-list { margin-top: 2px; }
