/* Sign-in pages and the customer dashboard. Loaded after site.css and
   reuses its colours, fonts, buttons and glass look. */

[hidden] { display: none !important; }

.muted { color: var(--muted); }

/* glass box without the hover lift that marketing cards have */
.box {
  padding: 28px;
  border-radius: var(--radius);
  background: rgba(14, 20, 42, 0.72);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* ---------- form controls ---------- */
.field { display: grid; gap: 8px; margin-top: 18px; }
.field > span { font-size: 0.9375rem; font-weight: 500; }
.field input, .field select, .control {
  width: 100%;
  font: inherit;
  color: var(--text);
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(5, 8, 18, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: #7f7584; }
.field input:focus, .field select:focus, .control:focus {
  outline: none;
  border-color: var(--g2);
  box-shadow: 0 0 0 4px rgba(227, 185, 93, 0.16);
}
.field small { color: var(--muted); font-size: 0.875rem; }

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 20px;
  font-size: 0.9375rem;
  color: var(--muted);
}
.check input { flex: none; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--g1); }
.check a, .auth-switch a, .field-link { color: var(--g2); text-underline-offset: 3px; }

.link {
  font: inherit;
  padding: 0;
  border: 0;
  background: none;
  color: var(--g2);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

button.btn { font-family: var(--display); }
.btn[disabled] { opacity: 0.6; cursor: default; transform: none; }

.notice {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9375rem;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.45);
  color: #ffd5d5;
}
.notice.ok {
  background: rgba(93, 242, 166, 0.1);
  border-color: rgba(93, 242, 166, 0.4);
  color: #c9f9e0;
}
.notice a { color: inherit; }

.test-note {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9375rem;
  border: 1px dashed rgba(227, 185, 93, 0.6);
  background: rgba(227, 185, 93, 0.08);
  color: #f6e8c9;
}
.test-note strong { font-family: var(--mono); font-size: 1.125rem; letter-spacing: 0.12em; }

/* ---------- sign-in pages ---------- */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
  padding-top: clamp(32px, 6vw, 80px);
  padding-bottom: clamp(48px, 7vw, 96px);
  min-height: calc(100vh - 69px);
}
.auth-side h1 {
  font-size: clamp(2.3rem, 4.8vw, 3.6rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.auth-side .lede { margin-top: 18px; }
.ticks-col { flex-direction: column; gap: 14px; font-size: 1.0625rem; color: var(--text); }

.auth-card { padding: clamp(24px, 4vw, 38px); box-shadow: 0 40px 80px -50px rgba(63, 111, 255, 0.7); }
.auth-card h2 { font-size: 2rem; letter-spacing: -0.02em; }
.auth-card h2 + .muted { margin-top: 8px; }
.auth-card .btn-block { margin-top: 24px; }

.stepper {
  list-style: none;
  counter-reset: stage;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8125rem;
}
.stepper li {
  counter-increment: stage;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.stepper li::before { content: counter(stage) ". "; }
.stepper li.on { background: var(--grad); border-color: transparent; color: var(--on-grad); font-weight: 600; }
.stepper li.done { border-color: rgba(227, 185, 93, 0.4); color: #f3e1b9; }

.field-row { display: flex; justify-content: flex-end; margin-top: 10px; font-size: 0.9375rem; }
.form-links { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.9375rem; }
.auth-switch { margin-top: 22px; text-align: center; color: var(--muted); font-size: 0.9375rem; }
.code-input { font-family: var(--mono) !important; font-size: 1.5rem !important; letter-spacing: 0.4em; text-align: center; }
.done-box { margin-top: 24px; text-align: center; }
.done-box h3 { font-size: 1.5rem; }

/* ---------- dashboard ---------- */
.dash-user { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 0.9375rem; }
.dash-email { color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  background: rgba(227, 185, 93, 0.12);
  border: 1px solid rgba(227, 185, 93, 0.35);
  color: #f6e8c9;
  font-variant-numeric: tabular-nums;
}

.dash { padding-top: 28px; padding-bottom: 96px; }
.dash h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); letter-spacing: -0.02em; }

.tabs {
  display: flex;
  gap: 6px;
  margin-top: 22px;
  padding-bottom: 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.tabs a {
  flex: none;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s, background-color 0.2s;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(227, 185, 93, 0.35);
}

.panel { margin-top: 26px; }
.panel h2 { font-size: 1.5rem; letter-spacing: -0.015em; }
.panel-intro { margin-top: 6px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat-label { font-size: 0.9375rem; color: var(--muted); }
.stat-value {
  margin-top: 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .link, .stat a { display: inline-block; margin-top: 10px; font-size: 0.9375rem; color: var(--g2); }

.section-gap { margin-top: 20px; }

.table-wrap { margin-top: 16px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
table.data th, table.data td { padding: 12px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.data th { font-weight: 500; color: var(--muted); font-size: 0.875rem; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .mono { font-family: var(--mono); font-size: 0.875rem; color: #f6e8c9; }
table.data input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--g1); }
.plus { color: #8ff0bf; }
.soon { color: var(--g2); }
.late { color: #ff9c9c; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8125rem; border: 1px solid var(--line); }
.badge-delivered { color: #c9f9e0; border-color: rgba(93, 242, 166, 0.4); background: rgba(93, 242, 166, 0.08); }
.badge-refunded { color: #ffd5d5; border-color: rgba(255, 107, 107, 0.45); background: rgba(255, 107, 107, 0.1); }
.badge-pending, .badge-review, .badge-syncing { color: #f6e8c9; border-color: rgba(227, 185, 93, 0.4); background: rgba(227, 185, 93, 0.08); }

.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty p { margin-bottom: 18px; }

/* buy form */
.buy { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.type-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.type-option { position: relative; display: block; cursor: pointer; }
.type-option input { position: absolute; opacity: 0; pointer-events: none; }
.type-option span {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, background-color 0.2s;
}
.type-option strong { font-family: var(--display); font-size: 1.0625rem; }
.type-option em { font-style: normal; font-size: 0.8125rem; color: var(--muted); }
.type-option:hover span { border-color: rgba(255, 255, 255, 0.26); }
.type-option input:checked + span {
  background: linear-gradient(var(--bg-raised), var(--bg-raised)) padding-box, var(--grad) border-box;
  border-color: transparent;
}
.type-option input:focus-visible + span { outline: 2px solid var(--g2); outline-offset: 3px; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.legend { font-size: 0.9375rem; font-weight: 500; }

.summary { position: sticky; top: 92px; }
.summary h3 { font-size: 1.25rem; }
.summary dl { margin: 16px 0 0; display: grid; gap: 10px; font-size: 0.9375rem; }
.summary dl div { display: flex; justify-content: space-between; gap: 16px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.summary .total { padding-top: 14px; border-top: 1px solid var(--line); align-items: baseline; }
.summary .total dd { font-family: var(--display); font-weight: 700; font-size: 2rem; letter-spacing: -0.02em; }
.summary .btn-block { margin-top: 20px; }

/* proxy list tools */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 16px; }
.toolbar .field { margin-top: 0; min-width: 150px; }
.toolbar .field > span { font-size: 0.8125rem; color: var(--muted); font-weight: 400; }
.toolbar .field select { padding: 11px 14px; }
.toolbar .btn { padding: 13px 18px; font-size: 0.9375rem; border-radius: 12px; }
.toolbar-split { margin-left: auto; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }

/* top up */
.amounts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.amounts button {
  font: inherit;
  font-family: var(--display);
  font-weight: 600;
  color: var(--text);
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.amounts button:hover { border-color: rgba(255, 255, 255, 0.26); }
.amounts button[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: var(--on-grad); }
.topup { max-width: 560px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 40;
  transform: translateX(-50%);
  max-width: min(92vw, 520px);
  padding: 14px 20px;
  border-radius: 14px;
  background: #141c36;
  border: 1px solid rgba(93, 242, 166, 0.45);
  color: #dffbec;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.9);
}
.toast.bad { border-color: rgba(255, 107, 107, 0.55); color: #ffd5d5; }

@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .auth-side .ticks-col { display: none; }
  .buy { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar-split { margin-left: 0; }
}
@media (max-width: 640px) {
  .dash-email { display: none; }
  .box { padding: 20px; }
}

/* keep the header on one line on narrow screens */
.brand, .btn, .balance-pill { white-space: nowrap; }
@media (max-width: 640px) {
  .top-in { gap: 12px; }
  .dash-user { gap: 8px; }
}

/* ---------- policy pages ---------- */
.legal {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
  padding-top: clamp(28px, 5vw, 56px);
  padding-bottom: clamp(56px, 8vw, 104px);
}
.legal-nav { position: sticky; top: 92px; display: grid; gap: 6px; }
.legal-nav a {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
.legal-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.legal-nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(227, 185, 93, 0.35);
}
.legal-body { padding: clamp(24px, 4vw, 44px); max-width: 820px; }
.legal-body h1 { font-size: clamp(2rem, 4vw, 2.75rem); letter-spacing: -0.025em; }
.legal-date { margin-top: 8px; font-size: 0.9375rem; color: var(--muted); }
.legal-body h2 { margin-top: 34px; font-size: 1.375rem; letter-spacing: -0.01em; }
.legal-body p { margin-top: 14px; color: #ddd3dc; max-width: 68ch; }
.legal-body ul { margin: 14px 0 0; padding-left: 22px; color: #ddd3dc; max-width: 68ch; }
.legal-body li { margin-top: 8px; }
.legal-body li::marker { color: var(--g2); }
.legal-body strong { color: var(--text); }
.legal-body a { color: var(--g2); text-underline-offset: 3px; }
@media (max-width: 760px) {
  .legal { grid-template-columns: minmax(0, 1fr); }
  .legal-nav { position: static; display: flex; flex-wrap: wrap; }
}

/* admin page: five figures in a row */
.admin-stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.admin-stats .muted { margin-top: 8px; font-size: 0.875rem; }

/* dashboard header and tabs on a phone */
@media (max-width: 640px) {
  .dash-user { gap: 6px; }
  .dash-user .btn-small { padding: 9px 10px; }
  .balance-pill { padding: 8px 11px; }
  .tabs { scroll-padding: 0 24px; }
}
#renew-hint { margin-top: 14px; }
