/* ───────────────────────────────────────────────────────────────────
   Account / auth pages (signup, login, reset, profile) + affiliate landing.
   Uses the global tokens from base.njk (--navy, --rust, --cream, etc.).
   Loaded only on /account/* and utility pages.
─────────────────────────────────────────────────────────────────── */

.acct {
  max-width: 560px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}
.acct--wide { max-width: 760px; }

.acct-card {
  background: var(--card);
  border: 1px solid var(--wg200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 36px;
}

.acct h1 {
  font-family: var(--serif);
  color: var(--navy);
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.1;
  margin: 0 0 8px;
}
.acct .acct-sub {
  color: var(--wg600);
  font-size: 1rem;
  margin: 0 0 28px;
}
.acct .eyebrow { margin-bottom: 14px; }

/* Fields */
.field { margin-bottom: 18px; }
.field > label {
  display: block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--navy);
  margin-bottom: 6px;
}
.field .hint { font-weight: 400; color: var(--wg500); font-size: 0.8rem; }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="url"],
.field select {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--navy);
  background: #fff;
  border: 1.5px solid var(--wg300);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(184, 92, 56, 0.15);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

/* Checkbox rows */
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--navy);
  line-height: 1.45;
}
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--rust); flex: 0 0 auto; }
.check a { color: var(--rust); }

.acct .btn { width: 100%; justify-content: center; margin-top: 6px; }
.acct .btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.acct-links {
  margin-top: 22px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--wg600);
}
.acct-links a { color: var(--rust); font-weight: 600; }
.acct-links .sep { margin: 0 8px; color: var(--wg300); }

/* Inline status / alerts */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: none;
}
.alert.show { display: block; }
.alert-error   { background: #fdecea; border: 1px solid #e7a99f; color: #8f2c1b; }
.alert-success { background: #eaf6ee; border: 1px solid #a6cfb4; color: #1f5b34; }
.alert-info    { background: #eef3f7; border: 1px solid #b4c8d6; color: #284b63; }

/* Profile sub-sections */
.acct-section-title {
  font-family: var(--serif);
  color: var(--navy);
  font-size: 1.15rem;
  margin: 30px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--wg200);
}
.acct-section-title:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }

.acct-toprow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}
.acct-toprow .btn { width: auto; margin: 0; }

.gate-msg { text-align: center; color: var(--wg600); padding: 40px 0; }

/* ── Affiliate dashboard ─────────────────────────────────────────── */
.dash { max-width: 1080px; margin: 0 auto; padding: 56px 24px 96px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.dash-head h1 { font-family: var(--serif); color: var(--navy); font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 4px 0 0; }

/* Prominent affiliate code / share-link banner */
.code-banner {
  background: var(--navy);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
}
.code-banner .eyebrow { color: var(--rust); margin-bottom: 8px; }
.code-banner .code {
  font-family: var(--serif);
  font-size: clamp(2rem, 6vw, 2.8rem);
  letter-spacing: 2px;
  line-height: 1;
  margin: 0 0 16px;
}
.code-banner .share-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.75; margin: 12px 0 4px; }
.code-banner a[data-copy] {
  color: var(--cream);
  font-weight: 600;
  word-break: break-all;
  cursor: pointer;
  border-bottom: 1px dashed rgba(240,235,224,0.5);
}
.code-banner .meta { margin-top: 16px; font-size: 0.85rem; opacity: 0.8; }
.code-banner .meta strong { color: var(--cream); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
@media (max-width: 820px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .stat-grid { grid-template-columns: 1fr; } }
.stat-card {
  background: var(--card);
  border: 1px solid var(--wg200);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.stat-card .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--wg500); margin: 0 0 8px; }
.stat-card .value { font-family: var(--serif); font-size: 2rem; color: var(--navy); line-height: 1; margin: 0; }
.stat-card .sub { font-size: 0.8rem; color: var(--wg600); margin: 10px 0 0; }
.stat-card .sub span { font-weight: 600; color: var(--navy); }

/* Chart panels */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 30px; }
@media (max-width: 820px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card {
  background: var(--card);
  border: 1px solid var(--wg200);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.chart-card h3 { font-family: var(--serif); color: var(--navy); font-size: 1.1rem; margin: 0 0 14px; }
.chart-card .canvas-wrap { position: relative; height: 240px; }
.chart-card.full { grid-column: 1 / -1; }
.chart-card.full .canvas-wrap { height: 180px; }

/* ── Admin panel ─────────────────────────────────────────────────── */
.adm-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--wg200); margin-bottom: 22px; }
.adm-tab {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  font-family: var(--sans); font-weight: 600; font-size: 0.92rem; color: var(--wg600);
  padding: 10px 14px; cursor: pointer;
}
.adm-tab:hover { color: var(--navy); }
.adm-tab.is-active { color: var(--rust); border-bottom-color: var(--rust); }

.adm-card {
  background: var(--card); border: 1px solid var(--wg200); border-radius: var(--radius-md);
  padding: 22px 24px; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.adm-card h3 { font-family: var(--serif); color: var(--navy); font-size: 1.15rem; margin: 0 0 16px; }

.adm-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.adm-table th, .adm-table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--wg200); vertical-align: middle; }
.adm-table th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--wg500); }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-table input, .adm-table select {
  font-family: var(--sans); font-size: 0.85rem; padding: 6px 8px;
  border: 1px solid var(--wg300); border-radius: var(--radius-sm); background: #fff; max-width: 130px;
}
.adm-wrap-scroll { overflow-x: auto; }
.adm-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.adm-table th.sortable:hover { color: var(--rust); }
.adm-table tr.adm-detail td { background: var(--wg100); color: var(--wg600); font-size: 0.82rem; }
.adm-table td a[data-book] { color: var(--rust); font-weight: 600; cursor: pointer; }

.adm-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; }
.adm-pill.active, .adm-pill.approved, .adm-pill.paid { background: #eaf6ee; color: #1f5b34; }
.adm-pill.pending, .adm-pill.draft { background: #fff5e6; color: #8a5a00; }
.adm-pill.suspended, .adm-pill.expired, .adm-pill.reversed { background: #fdecea; color: #8f2c1b; }
.adm-pill.terminated, .adm-pill.rejected, .adm-pill.used { background: var(--wg200); color: var(--wg600); }

.btn-xs { padding: 6px 12px; font-size: 0.8rem; border-radius: var(--radius-sm); }

.adm-form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 8px; }
.adm-form-row .field { margin-bottom: 0; flex: 1 1 160px; }

.adm-overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 820px) { .adm-overview-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .adm-overview-grid { grid-template-columns: 1fr; } }

.adm-token-box {
  background: var(--wg100); border: 1px dashed var(--wg400); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-top: 12px; word-break: break-all; font-size: 0.85rem;
}
.adm-token-box a { color: var(--rust); font-weight: 600; cursor: pointer; }

/* Commission structure list (dashboard) */
.comm-structure { display: flex; flex-direction: column; }
.comm-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--wg200);
  font-size: 0.92rem; color: var(--wg600);
}
.comm-row:last-child { border-bottom: 0; }
.comm-row strong { color: var(--navy); white-space: nowrap; }

/* Admin: invite commission rows */
.adm-subhead { font-family: var(--sans); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--wg500); margin: 18px 0 8px; }
.adm-comm-row .comm-label { flex: 1 1 180px; }
.adm-comm-row .comm-label label { font-weight: 600; color: var(--navy); }

/* Affiliate landing bounce */
.affil-bounce { text-align: center; padding: 100px 24px; }
.affil-bounce .spinner {
  width: 34px; height: 34px; margin: 0 auto 18px;
  border: 3px solid var(--wg300); border-top-color: var(--rust);
  border-radius: 50%; animation: wt-spin 0.7s linear infinite;
}
@keyframes wt-spin { to { transform: rotate(360deg); } }
