/* ==========================================================================
   gift.css - /gift/, /gift/thanks/ and /gift/manage/ only (pages/giftPage.mjs).

   Loaded AFTER tokens.css and seo-hub.css (which supplies the breadcrumb). It
   extends, never redefines: every selector is namespaced `giftpg-`, every value
   is a token, so the dark theme comes for free. No box-shadows, no literal colours.

   There is no error colour in this design system (the same note as .cta-status in
   home.css): an error is carried by WEIGHT and a thicker edge, and every error
   also says what is wrong in words, so nothing depends on seeing a hue.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero: the shared navy hub hero (sportHub.mjs hubHero, styles in seo-hub.css).
   Only the points card is this page's own.
   -------------------------------------------------------------------------- */

.giftpg-points {
  margin: 0;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  list-style: none;
}
.giftpg-point {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: var(--fs-body);
  line-height: 1.5;
}
.giftpg-point svg { flex: none; margin-top: 3px; }
.hub-top .giftpg-points { width: 400px; }
.hub-top .giftpg-point { font-size: 15.5px; }
.giftpg-thanks .giftpg-points { max-width: 720px; border-color: color-mix(in srgb, var(--accent) 42%, transparent); }
.giftpg-hero-cta { margin-top: 28px; }
@media (max-width: 980px) {
  .hub-top .giftpg-points { width: 100%; max-width: 520px; }
}

/* --------------------------------------------------------------------------
   The form
   -------------------------------------------------------------------------- */

.giftpg-buy-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(0, 360px);
  justify-content: space-between;
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.giftpg-form-wrap { min-width: 0; }
/* The recap beside the form: navy in both themes, and it stays in view while the form scrolls. */
.giftpg-summary {
  position: sticky;
  top: 112px;
  padding: 28px;
  border-radius: 24px;
}
.giftpg-summary-name { margin-top: 12px; font-family: var(--font-head); font-weight: 600; font-size: 26px; line-height: 1.1; }
.giftpg-summary-price { margin-top: 14px; display: flex; align-items: baseline; gap: 10px; }
.giftpg-summary-amount { font-family: var(--font-head); font-weight: 700; font-size: 52px; line-height: 1; }
.giftpg-summary-per { font-size: 15px; opacity: .75; }
.giftpg-summary-list { list-style: none; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid rgba(242, 242, 243, .16); display: grid; gap: 12px; }
.giftpg-summary-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.45; }
.giftpg-summary-list svg { flex: none; margin-top: 3px; }
@media (max-width: 1080px) {
  .giftpg-buy-grid { grid-template-columns: minmax(0, 1fr); }
  .giftpg-summary { position: static; order: -1; max-width: 760px; }
}
.giftpg-form {
  padding: clamp(20px, 3.4vw, 36px);
  border-radius: 24px;
  background: var(--bg);
  border-color: var(--hairline);
  box-shadow: 0 24px 50px -30px color-mix(in srgb, var(--accent-strong) 60%, transparent);
}
.giftpg-form.is-off { opacity: .6; }
.giftpg-fields { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 30px; }

.giftpg-group { display: grid; gap: 14px; }
.giftpg-group + .giftpg-group { padding-top: 28px; border-top: 1px solid var(--divider); }
.giftpg-group-title { font-family: var(--font-head); font-weight: 600; font-size: 24px; line-height: 1.15; }
.giftpg-group-note { margin-top: -6px; }

.giftpg-field { display: grid; gap: 6px; }
.giftpg-field label { font-weight: 600; font-size: var(--fs-small); }
.giftpg-optional { font-weight: 400; color: var(--text-secondary); }

.giftpg-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--divider);
  border-radius: var(--r-control);
  background: var(--surface);
  font-family: inherit;
  color: var(--text);
  font-size: 16px;                 /* 16px so a phone does not zoom the page on focus */
}
.giftpg-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.giftpg-textarea { min-height: 112px; padding-block: 12px; line-height: 1.5; resize: vertical; }
.giftpg-input:disabled { opacity: .55; cursor: not-allowed; }
.giftpg-input[aria-invalid="true"] { border-width: 2px; border-color: var(--text); padding-inline: 15px; }
.giftpg-textarea[aria-invalid="true"] { padding-block: 11px; }

.giftpg-field[hidden] { display: none; }
.giftpg-radios { display: grid; gap: 2px; }
.giftpg-date { max-width: 260px; }
/* The chosen day, echoed back. It lives inside the date field, so it only shows when "On a date" is picked. */
.giftpg-when { color: var(--text-copy); font-weight: 600; }
.giftpg-when:empty { display: none; }
.giftpg-hint { font-size: var(--fs-fine); line-height: 1.45; color: var(--text-secondary); }
.giftpg-err { font-size: var(--fs-small); line-height: 1.45; font-weight: 600; color: var(--text); }
.giftpg-err[hidden] { display: none; }
.giftpg-count { color: var(--text-secondary); }
.giftpg-count.is-over { color: var(--text); font-weight: 700; }

.giftpg-check-label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
}
.giftpg-check-label input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent-strong);
}

.giftpg-pay { display: grid; gap: 10px; padding-top: 22px; border-top: 1px solid var(--divider); }
.giftpg-total { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: var(--fs-lede); }
.giftpg-total-label { font-family: var(--font-head); font-weight: 600; letter-spacing: .04em; }
.giftpg-total-amount { font-family: var(--font-head); font-size: 34px; line-height: 1; }
.giftpg-submit { margin-top: 6px; }
.giftpg-submit:disabled { opacity: .7; cursor: progress; }

.giftpg-status { font-size: var(--fs-small); line-height: 1.5; color: var(--text-copy); }
.giftpg-status.is-ok { color: var(--accent-strong); font-weight: 600; }
.giftpg-status.is-err { color: var(--text); font-weight: 600; }
.giftpg-status[hidden] { display: none; }

/* The sale-state panels. */
.giftpg-off,
.giftpg-nojs { margin-bottom: 20px; padding: 22px 24px; }
.giftpg-off[hidden] { display: none; }
.giftpg-off-title { font-size: var(--fs-h3); margin-bottom: 8px; }
.giftpg-off-cta { margin-top: 18px; }
.giftpg-checking { margin-bottom: 16px; color: var(--text-copy); }
.giftpg-checking[hidden] { display: none; }

.giftpg-legal { margin-top: 18px; }

/* --------------------------------------------------------------------------
   How it works
   -------------------------------------------------------------------------- */

.giftpg-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 28px 32px;
}
.giftpg-step { padding-top: 18px; border-top: 2px solid var(--accent); min-width: 0; }
.giftpg-step-n { display: block; font-family: var(--font-head); font-weight: 700; font-size: 44px; line-height: 1; color: var(--accent-strong); }
.giftpg-step .prose { margin-top: 12px; font-size: 15.5px; line-height: 1.55; }
.giftpg-app { margin-top: clamp(32px, 4vw, 52px); max-width: 760px; padding: 20px 24px; line-height: 1.5; }

/* --------------------------------------------------------------------------
   The manage page
   -------------------------------------------------------------------------- */

.giftpg-manage-body { display: grid; gap: 20px; max-width: 760px; }
.giftpg-manage-body:empty { display: none; }
.giftpg-notice { margin-top: 18px; max-width: 720px; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r-chip) var(--r-chip) 0; }
.giftpg-notice[hidden] { display: none; }

.giftpg-panel, .giftpg-actions { border-radius: 20px; border-color: color-mix(in srgb, var(--accent) 42%, transparent); }
.giftpg-panel { padding: 24px 26px; display: grid; gap: 12px; justify-items: start; }
.giftpg-panel-title { font-family: var(--font-head); font-weight: 600; font-size: 28px; line-height: 1.1; }

.giftpg-rows { width: 100%; margin-top: 8px; display: grid; }
.giftpg-row { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr); gap: 14px; padding-block: 11px; border-top: 1px solid var(--hairline); }
.giftpg-row dt { font-family: var(--font-mono); font-weight: 600; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); line-height: 1.7; }
.giftpg-row dd { margin: 0; overflow-wrap: anywhere; }

.giftpg-actions { padding: 8px 26px; display: grid; }
.giftpg-action { padding-block: 22px; display: grid; gap: 10px; justify-items: start; }
.giftpg-action + .giftpg-action { border-top: 1px solid var(--divider); }
.giftpg-action-title { font-family: var(--font-head); font-weight: 600; font-size: 22px; line-height: 1.15; }
.giftpg-action .giftpg-field { width: 100%; max-width: 440px; }

.giftpg-linkbox { width: 100%; display: grid; gap: 10px; justify-items: start; }
.giftpg-linkfield { max-width: 100%; font-size: 14px; }
.giftpg-confirm { display: grid; gap: 12px; padding: 16px 18px; border: 2px solid var(--text); border-radius: var(--r-control); }
.giftpg-confirm-text { font-weight: 600; }
.giftpg-confirm-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.giftpg-reload { margin-top: -4px; }
.giftpg-confirm-slot { width: 100%; display: grid; justify-items: start; }

@media (max-width: 560px) {
  .giftpg-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .giftpg-panel,
  .giftpg-actions { padding-inline: 18px; }
  .giftpg-confirm-btns .btn { width: 100%; }
  .giftpg-action > .btn,
  .giftpg-confirm-slot > .btn,
  .giftpg-linkbox .btn { width: 100%; }
  .giftpg-panel .btn,
  .giftpg-actions .btn { white-space: normal; text-align: center; height: auto; padding-block: 12px; line-height: 1.1; }
}
