/* ═══════════════════════════════════════════════════════════
   Creator program — landing, login, apply, dashboard
   Builds on top of styles.css (brand tokens + base components).
   ═══════════════════════════════════════════════════════════ */

/* The HTML `hidden` attribute uses display:none at user-agent priority.
   Class-based `display: flex/grid/etc` overrides it, which would leak
   pre-submit success / error blocks. Force hidden to always win. */
[hidden] { display: none !important; }

/* ── Active nav state ─────────────────────────────────────── */
.nav__active { color: var(--brand) !important; font-weight: 700; }

/* ── Landing hero ─────────────────────────────────────────── */
.creators-hero {
  padding: 80px 0 48px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(11,127,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(96,165,250,0.10) 0%, transparent 55%),
    var(--bg);
  text-align: center;
}
.creators-hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 16px;
}
.creators-hero h1 span { color: var(--brand); }
.creators-hero .creators-sub {
  font-size: 1.05rem;
  color: var(--text-sub);
  max-width: 640px;
  margin: 0 auto 28px;
  line-height: 1.6;
}
.creators-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-bg);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}
.creators-cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Steps ────────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.step {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-light);
  padding: 24px;
  position: relative;
}
.step__num {
  position: absolute;
  top: -12px;
  left: 24px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step h3 { margin: 8px 0 8px; font-size: 1.05rem; }
.step p  { font-size: 0.9rem; color: var(--text-sub); line-height: 1.6; }
.kbd {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.85em;
  color: var(--brand);
  font-weight: 700;
}

/* ── FAQ ──────────────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq {
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  padding: 16px 20px;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  font-size: 0.95rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  float: right;
  color: var(--brand);
  font-weight: 700;
}
.faq[open] summary::after { content: '–'; }
.faq p { margin-top: 10px; color: var(--text-sub); font-size: 0.92rem; line-height: 1.6; }

/* ── Auth pages (login + apply) ───────────────────────────── */
.creators-auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(11,127,255,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(96,165,250,0.14) 0%, transparent 55%),
    var(--bg);
}
.creators-auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 40px 32px 32px;
  box-shadow: 0 20px 60px -20px rgba(11,30,60,0.18);
  position: relative;
}
.creators-auth-card--wide { max-width: 560px; }
.creators-auth-back {
  position: absolute;
  top: 18px;
  left: 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.creators-auth-logo { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 16px; }
.creators-auth-card h1 {
  font-size: 1.6rem;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.creators-auth-sub {
  color: var(--text-sub);
  font-size: 0.92rem;
  margin-bottom: 26px;
  line-height: 1.5;
}
.creators-auth-form { display: flex; flex-direction: column; gap: 4px; }
.creators-auth-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 14px 0 6px;
}
.creators-auth-label:first-child { margin-top: 0; }
.creators-auth-input {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--text);
  font-family: inherit;
  width: 100%;
}
.creators-auth-input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}
.creators-auth-code { letter-spacing: 0.08em; text-transform: uppercase; }
.creators-auth-optional { font-weight: 500; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.creators-auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-sub);
  line-height: 1.5;
  margin: 18px 0 6px;
  cursor: pointer;
}
.creators-auth-checkbox input { margin-top: 3px; flex-shrink: 0; }
.creators-auth-submit { margin-top: 16px; width: 100%; justify-content: center; }
.creators-auth-error {
  background: rgba(239,68,68,0.10);
  border: 1px solid rgba(239,68,68,0.35);
  color: var(--danger);
  font-size: 0.85rem;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  margin-top: 12px;
  line-height: 1.5;
}
.creators-auth-row {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 0.85rem;
}
.creators-auth-row a { color: var(--brand); font-weight: 600; }
.creators-auth-success {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
}
.creators-auth-success h2 { font-size: 1.4rem; }
.creators-auth-success p { color: var(--text-sub); max-width: 360px; }

/* ── Dashboard ───────────────────────────────────────────── */
.creators-dash-body { background: var(--bg); min-height: 100vh; }
.creators-dash-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
}
.creators-dash-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.creators-dash-actions { display: flex; align-items: center; gap: 14px; }
.creators-dash-email {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}
.btn--sm { padding: 7px 14px; font-size: 0.8rem; }

.creators-dash-main { padding: 32px var(--sp-lg); max-width: 1080px; }

.creators-dash-loading {
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
}
.creators-dash-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.creators-dash-empty {
  text-align: center;
  padding: 80px 24px;
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-light);
}
.creators-dash-empty ion-icon { font-size: 56px; color: var(--brand); margin-bottom: 12px; }
.creators-dash-empty h2 { margin-bottom: 8px; }
.creators-dash-empty p { color: var(--text-sub); max-width: 480px; margin: 0 auto; line-height: 1.6; }

/* Hero card */
.creators-dash-hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  box-shadow: 0 16px 40px -16px rgba(11,127,255,0.4);
  margin-bottom: 24px;
}
.creators-dash-greet { font-size: 0.85rem; opacity: 0.85; }
.creators-dash-hero h1 { color: #fff; font-size: 1.75rem; margin: 4px 0 6px; }
.creators-dash-status { font-size: 0.85rem; opacity: 0.85; }
.creators-dash-codes {
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(14px);
  border-radius: var(--r-lg);
  padding: 14px 20px;
  text-align: center;
}
.creators-dash-codes-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  opacity: 0.8;
  margin-bottom: 4px;
}
.creators-dash-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.creators-dash-copy {
  margin-top: 8px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.creators-dash-copy:hover { background: rgba(255,255,255,0.3); }

/* Stat cards */
.creators-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.creators-stat {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  border: 1px solid var(--border-light);
}
.creators-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}
.creators-stat-num {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant: tabular-nums;
}
.creators-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Activity tables */
.creators-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.creators-table-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  border: 1px solid var(--border-light);
}
.creators-table-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.creators-table-head h3 { font-size: 0.95rem; }
.creators-table-meta { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.creators-table-body { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.creators-table-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-light);
}
.creators-table-row:last-child { border-bottom: none; }
.creators-table-bullet {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}
.creators-table-label { flex: 1; font-size: 0.88rem; }
.creators-table-date { font-size: 0.78rem; color: var(--text-muted); }
.creators-table-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 24px 0;
  text-align: center;
}

.creators-dash-foot {
  margin-top: 32px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Mobile tweaks ────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Hero typography sizes down */
  .creators-hero { padding: 56px 0 32px; }
  .creators-hero h1 { font-size: 2rem; }
  .creators-hero .creators-sub { font-size: 0.95rem; }
  .creators-cta-row .btn { width: 100%; justify-content: center; }
  .creators-cta-row { flex-direction: column; gap: 8px; }

  /* Steps stack one per row with breathing room */
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  /* Dashboard hero stacks; code badge goes full-width */
  .creators-dash-hero { flex-direction: column; align-items: stretch; padding: 22px 22px; }
  .creators-dash-codes { width: 100%; text-align: center; }
  .creators-dash-email { display: none; }
  .creators-dash-main { padding: 20px 16px; }
  .creators-dash-header__inner { height: 56px; }

  /* Stat cards become 2-up on phones, then 1-up under 380px */
  .creators-stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .creators-stat { padding: 16px; }
  .creators-stat-num { font-size: 1.6rem; }

  /* Tables full-width single column */
  .creators-tables { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  /* Auth cards drop their large outer padding so the form fits comfortably */
  .creators-auth-body { padding: 16px 12px; }
  .creators-auth-card { padding: 32px 22px 22px; }
  .creators-auth-card h1 { font-size: 1.4rem; }
  .creators-stat-grid { grid-template-columns: 1fr; }
}
