/* Toktoky Captain Magnet Portal — v1
   Layered on top of home.v5.css design tokens. */

/* Hero adjustments */
.captain-hero { padding-bottom: 36px; }
.captain-hero .hero-title { font-size: clamp(32px, 8.4vw, 56px); }
.captain-hero .hero-sub { max-width: 42ch; }
.captain-hero .hero-cta { gap: 12px; }
.captain-hero .cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; width: 100%; max-width: 480px; }
.captain-hero .cta-row .btn { flex: 1 1 auto; }
.captain-hero .btn-ghost-dark { background: transparent; color: var(--on-brand); border: 2px solid rgba(0, 0, 0, .75); }
.captain-hero .btn-ghost-dark:hover { background: rgba(0, 0, 0, .08); }

/* Referral banner (hidden until JS detects ?ref=) */
.ref-banner {
  margin: 20px 0 0;
  padding: 16px;
  background: #0A0A0A;
  color: #FFFFFF;
  border-radius: var(--r-card);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  align-items: center;
  border: 2px solid var(--brand);
}
.ref-banner[hidden] { display: none !important; }
.ref-banner .ref-head { display: flex; align-items: center; gap: 10px; }
.ref-banner .ref-head .ref-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #0A0A0A; font: 700 20px/1 var(--f-display); flex: none; }
.ref-banner .ref-copy { font-weight: 700; line-height: 1.4; }
.ref-banner .ref-code-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ref-banner .ref-code {
  display: inline-grid; place-items: center; min-height: 44px; padding: 0 16px;
  background: var(--brand); color: #0A0A0A; font: 700 18px/1 var(--f-display);
  border-radius: var(--r-pill); letter-spacing: .08em;
}
.ref-banner .ref-copy-btn {
  min-height: 44px; padding: 0 16px; border-radius: var(--r-pill);
  border: 2px solid var(--brand); background: transparent; color: var(--brand); font-weight: 700; cursor: pointer;
}
.ref-banner .ref-copy-btn:hover { background: var(--brand); color: #0A0A0A; }
.ref-banner .ref-status { min-height: 1.4em; color: #3DD68C; font-size: 14px; font-weight: 700; }

/* Earnings calculator */
.calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sheet);
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}
.calc-inputs { display: grid; gap: 16px; }
.calc-field { display: grid; gap: 8px; }
.calc-field label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 700; color: var(--text); }
.calc-field label output {
  font: 700 18px/1 var(--f-display); color: var(--on-brand);
  background: var(--brand); padding: 6px 12px; border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}
.calc-field input[type="range"] { width: 100%; accent-color: #0A0A0A; height: 44px; }
.calc-hint { color: var(--text-2); font-size: 13px; font-weight: 600; }

.calc-out { display: grid; gap: 10px; }
.calc-result {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline;
  padding: 14px 16px; border-radius: var(--r-card);
  background: var(--brand-soft); border: 1px solid var(--brand);
}
.calc-result.hero-result { background: #0A0A0A; color: #FFFFFF; border-color: #0A0A0A; }
.calc-result .r-label { font-weight: 700; font-size: 15px; }
.calc-result .r-value { font: 700 22px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.calc-result.hero-result .r-value { color: var(--brand); font-size: 28px; }

.calc-disclaimer { color: var(--text-2); font-size: 13px; line-height: 1.6; }

.prize-card {
  background: var(--night-bg); color: var(--night-text);
  border-radius: var(--r-card); padding: 16px 18px;
  display: grid; gap: 10px;
}
.prize-card .prize-title { font: 700 18px/1.3 var(--f-display); color: var(--brand); display: flex; align-items: center; gap: 8px; }
.prize-list { display: grid; gap: 6px; }
.prize-list li { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--night-surface-2); border-radius: var(--r-chip); font-weight: 700; }
.prize-list .rank { color: var(--brand); font: 700 15px/1 var(--f-display); }
.prize-list .amt { font-variant-numeric: tabular-nums; }

/* Onboarding */
.onboard { background: var(--surface); border-block: 1px solid var(--border); }
.onboard-steps { margin-top: 24px; display: grid; gap: 12px; counter-reset: s; }
.onboard-step {
  display: grid; grid-template-columns: 56px 1fr; column-gap: 14px; align-items: start;
  padding: 18px; background: var(--bg); border-radius: var(--r-card);
}
.onboard-step .n { grid-row: span 2; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font: 700 24px/1 var(--f-display); }
.onboard-step h3 { font: 700 19px/1.4 var(--f-body); align-self: end; }
.onboard-step p { color: var(--text-2); }

/* Why cards — reuse .cards grid; add small variant */
.why { background: var(--bg); }
.why .cards .c-ic { background: var(--brand); color: var(--on-brand); }
.why .cards .c-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Poster block (screen) */
.poster {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sheet); padding: 24px;
  display: grid; gap: 18px; grid-template-columns: 1fr;
  box-shadow: var(--shadow);
  align-items: center;
}
.poster-copy h3 { font: 700 22px/1.3 var(--f-display); }
.poster-copy p { margin-top: 8px; color: var(--text-2); line-height: 1.7; }
.poster-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }
.poster-print-btn {
  min-height: 52px; padding: 0 20px; border: 0; border-radius: var(--r-pill);
  background: #0A0A0A; color: #FFFFFF; font: 700 16px/1 var(--f-body); cursor: pointer;
}
.poster-print-btn:hover { background: #262626; }
.poster-qr {
  background: #FFFFFF; border-radius: var(--r-card); padding: 18px;
  display: grid; justify-items: center; gap: 10px;
  border: 1px solid var(--border);
}
.poster-qr svg { width: 220px; height: auto; display: block; }
.poster-qr .qr-caption { font: 700 14px/1.3 var(--f-display); color: #0A0A0A; }

/* FAQ shares .faq styles from home.v5.css */

/* Final CTA like index .final */
.final-captain { background: var(--brand); color: var(--on-brand); padding: 44px 0; }
.final-captain .final-in { display: grid; gap: 18px; justify-items: start; }
.final-captain .final-title { font: 700 clamp(28px, 7vw, 44px)/1.25 var(--f-display); }

/* Dual CTA card on track.html */
.track-dual-cta {
  margin: 14px 0 0;
  padding: 16px;
  background: #FFFFFF;
  color: #0A0A0A;
  border-radius: 18px;
  display: grid;
  gap: 12px;
  border: 1px solid #E6E8EC;
}
.track-dual-cta .t-title { font: 700 17px/1.3 'IBM Plex Sans Arabic', 'Cairo', system-ui, sans-serif; }
.track-dual-cta .t-row { display: grid; gap: 8px; }
.track-dual-cta .t-btn {
  min-height: 48px; padding: 0 18px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; font-weight: 700; font-size: 15px;
}
.track-dual-cta .t-btn-brand { background: #FDBC04; color: #0A0A0A; }
.track-dual-cta .t-btn-ink { background: #0A0A0A; color: #FFFFFF; }

/* Index.html captain recruit banner */
.captain-recruit {
  background: #0A0A0A; color: #FFFFFF;
  padding: 36px 0;
  border-top: 4px solid var(--brand);
  border-bottom: 4px solid var(--brand);
}
.captain-recruit .cr-grid { display: grid; gap: 18px; align-items: center; }
.captain-recruit .cr-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--brand); color: #0A0A0A; font-weight: 700; font-size: 14px; width: fit-content;
}
.captain-recruit .cr-title { font: 700 clamp(26px, 6vw, 36px)/1.25 var(--f-display); margin-top: 10px; }
.captain-recruit .cr-sub { margin-top: 10px; color: #D0D5DD; font-size: 17px; line-height: 1.6; max-width: 56ch; }
.captain-recruit .cr-actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.captain-recruit .btn-brand { color: #0A0A0A; }
.captain-recruit .btn-line { color: #FFFFFF; border-color: #FFFFFF; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Tablet / Desktop ---------- */
@media (min-width: 720px) {
  .onboard-steps { grid-template-columns: repeat(3, 1fr); }
  .onboard-step { grid-template-columns: 1fr; row-gap: 10px; padding: 24px; }
  .onboard-step .n { grid-row: auto; }
  .poster { grid-template-columns: 1.3fr 1fr; gap: 28px; padding: 32px; }
  .track-dual-cta .t-row { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  .calc { grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: start; }
  .calc > .calc-inputs { grid-column: 1; }
  .calc > .calc-out { grid-column: 2; }
  .ref-banner { grid-template-columns: auto 1fr auto; gap: 18px; padding: 20px 24px; }
  .captain-recruit .cr-grid { grid-template-columns: 1.3fr 1fr; gap: 40px; }
}

/* ---------- PRINT POSTER ---------- */
@media print {
  @page { size: A4; margin: 10mm; }
  html, body { background: #FFFFFF !important; color: #0A0A0A !important; }
  body > *:not(main) { display: none !important; }
  main > *:not(.poster-print-sheet) { display: none !important; }
  .poster-print-sheet { display: grid !important; }
}

/* The dedicated print sheet, hidden on screen, shown in print or when body has .is-print-preview */
.poster-print-sheet { display: none; }
body.is-print-preview .poster-print-sheet { display: grid; }
body.is-print-preview .site-header,
body.is-print-preview .site-footer,
body.is-print-preview main > section:not(.poster-print-sheet) { display: none !important; }

.poster-print-sheet {
  min-height: 277mm;
  padding: 14mm 12mm;
  grid-template-rows: auto 1fr auto;
  gap: 10mm;
  background: #FFFFFF;
  color: #0A0A0A;
  font-family: 'Alexandria', 'Cairo', system-ui, sans-serif;
}
.pp-head { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.pp-logo { width: 72px; height: 72px; border-radius: 16px; background: #FDBC04; display: grid; place-items: center; }
.pp-logo img { width: 56px; height: 56px; display: block; border-radius: 10px; }
.pp-brand { font: 800 36px/1 'Alexandria', 'Cairo', sans-serif; letter-spacing: -.01em; }
.pp-tag { font-weight: 700; font-size: 16px; color: #0A0A0A; }

.pp-body { display: grid; grid-template-columns: 1fr auto; gap: 14mm; align-items: center; }
.pp-h1 { font: 800 44px/1.2 'Alexandria', 'Cairo', sans-serif; }
.pp-h1 mark { background: #FDBC04; color: #0A0A0A; padding: 0 .18em .04em; border-radius: 12px; }
.pp-lead { margin-top: 12px; font-weight: 700; font-size: 22px; line-height: 1.5; }
.pp-list { margin-top: 18px; display: grid; gap: 10px; font-size: 20px; font-weight: 700; }
.pp-list li { display: flex; align-items: baseline; gap: 10px; }
.pp-list li::before { content: '•'; color: #FDBC04; font-size: 28px; line-height: .8; }

.pp-qr {
  background: #FFFFFF; padding: 10mm;
  border: 3px solid #0A0A0A; border-radius: 16px;
  display: grid; justify-items: center; gap: 8px; width: 78mm;
}
.pp-qr svg { width: 58mm; height: 58mm; display: block; }
.pp-qr .pp-qr-cap { font: 700 18px/1.2 'Alexandria', 'Cairo', sans-serif; text-align: center; }
.pp-qr .pp-qr-url { font: 600 12px/1.2 'Courier New', monospace; color: #0A0A0A; direction: ltr; }

.pp-foot {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end;
  border-top: 2px solid #0A0A0A; padding-top: 8mm;
}
.pp-cta { font: 800 26px/1.2 'Alexandria', 'Cairo', sans-serif; }
.pp-cta mark { background: #0A0A0A; color: #FDBC04; padding: 0 .3em .1em; border-radius: 10px; }
.pp-note { text-align: end; font-weight: 700; font-size: 14px; color: #0A0A0A; }

@media print {
  .pp-h1 { font-size: 40pt; }
  .pp-lead { font-size: 16pt; }
  .pp-list { font-size: 15pt; }
}
