/* VIPPRO MAIL — mệnh thổ (earth)
   Admin: warm dark ochre · OTP pages: light sand/cream */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  color-scheme: dark;
  --bg: #0c0a08;
  --bg-elev: #14110d;
  --bg-card: #1a1611;
  --bg-card-2: #211c16;
  --bg-input: #100e0b;
  --line: rgba(245, 210, 150, .08);
  --line-strong: rgba(245, 210, 150, .14);
  --text: #f6efe4;
  --text-2: #c4b29a;
  --text-3: #8f7f6a;
  --accent: #d4a017;
  --accent-dim: rgba(212, 160, 23, .14);
  --accent-border: rgba(212, 160, 23, .32);
  --accent-hover: #e8b84a;
  --accent-ink: #2a1c08;
  --danger: #e07a6a;
  --danger-dim: rgba(224, 122, 106, .12);
  --danger-border: rgba(224, 122, 106, .28);
  --warn: #e0a82e;
  --warn-dim: rgba(224, 168, 46, .12);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow: 0 0 0 1px var(--line), 0 18px 50px rgba(20, 12, 4, .5);
  --font: "DM Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 64px;
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background:
    radial-gradient(1100px 560px at 8% -12%, rgba(212, 160, 23, .12), transparent 55%),
    radial-gradient(800px 480px at 100% 0%, rgba(161, 98, 7, .08), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
code, .mono {
  font-family: var(--mono);
  font-size: .82em;
  font-feature-settings: "ss01";
}
::selection { background: rgba(212, 160, 23, .3); color: #fff8e7; }

/* ── layout ── */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  min-height: var(--nav-h);
  height: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: rgba(12, 10, 8, .78);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border-bottom: 1px solid var(--line);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(212, 160, 23, .28), rgba(161, 98, 7, .08));
  border: 1px solid var(--accent-border);
  color: var(--accent); font-weight: 700; font-size: .8rem;
  flex-shrink: 0;
}
.brand-title { font-size: .98rem; font-weight: 700; letter-spacing: -.02em; margin: 0; white-space: nowrap; }
.brand-sub {
  font-size: .72rem; color: var(--text-3); margin: 2px 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: min(420px, 46vw);
}
.topbar-actions {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: nowrap; justify-content: flex-end; flex-shrink: 0;
}
.topbar-actions .btn,
.topbar-actions button,
.topbar-actions a.btn {
  padding: 8px 12px;
  font-size: .8rem;
}
@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px;
  }
  .topbar-brand { width: 100%; flex: 1 1 100%; }
  .brand-sub { max-width: calc(100vw - 72px); }
  .topbar-actions {
    width: 100%;
    justify-content: stretch;
    gap: 6px;
  }
  .topbar-actions .btn,
  .topbar-actions button,
  .topbar-actions a.btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 9px 8px;
    font-size: .78rem;
  }
}
.page {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
  display: grid; gap: 18px;
  align-content: start;
  align-items: stretch;
  flex: 1;
}
.page > * { min-height: 0; }
.card-shell { height: fit-content; align-self: start; }
/* Mail check pages — compact column */
.page-narrow {
  width: min(520px, calc(100% - 28px));
  max-width: 520px;
  padding-top: 20px;
  gap: 12px;
}
.page-narrow .mail-frame {
  height: min(340px, calc(100dvh - 360px));
  min-height: 200px;
}
.page-narrow .otp-value {
  font-size: clamp(1.85rem, 6.5vw, 2.5rem);
  letter-spacing: .14em;
}
.page-narrow .otp-hero { padding: 20px 14px 18px; }
.page-narrow .card { padding: 16px; }
@media (max-width: 960px) {
  .page-narrow { width: calc(100% - 24px); }
}

/* OTP viewer pages — light mệnh thổ */
body.theme-earth {
  color-scheme: light;
  --bg: #f3ebe0;
  --bg-elev: #faf6ef;
  --bg-card: #fffdf8;
  --bg-card-2: #f8f1e6;
  --bg-input: #ffffff;
  --line: rgba(120, 80, 30, .12);
  --line-strong: rgba(120, 80, 30, .2);
  --text: #2c2116;
  --text-2: #6d5640;
  --text-3: #8d7560;
  --accent: #b45309;
  --accent-dim: rgba(180, 83, 9, .1);
  --accent-border: rgba(180, 83, 9, .3);
  --accent-hover: #9a3412;
  --accent-ink: #fffaf3;
  --danger: #b91c1c;
  --danger-dim: rgba(185, 28, 28, .08);
  --danger-border: rgba(185, 28, 28, .22);
  --warn: #a16207;
  --warn-dim: rgba(161, 98, 7, .1);
  --shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(90, 60, 20, .1);
  background:
    radial-gradient(900px 480px at 10% -10%, rgba(217, 119, 6, .12), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(180, 83, 9, .08), transparent 50%),
    linear-gradient(180deg, #f8f2e8 0%, #ebe0d0 100%);
  color: var(--text);
}
body.theme-earth .topbar {
  background: rgba(255, 252, 246, .88);
  border-bottom-color: var(--line);
}
body.theme-earth .brand-mark {
  background: linear-gradient(145deg, rgba(180, 83, 9, .2), rgba(217, 119, 6, .06));
  border-color: var(--accent-border);
  color: var(--accent);
}
body.theme-earth .card {
  background: linear-gradient(180deg, #fffefb 0%, #faf3e8 100%);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
body.theme-earth .card-shell {
  background: rgba(180, 83, 9, .05);
  border-color: var(--line);
}
body.theme-earth input[type=text],
body.theme-earth input[type=search],
body.theme-earth input[type=number],
body.theme-earth input[type=password],
body.theme-earth input[type=url],
body.theme-earth input[type=email],
body.theme-earth textarea {
  background: #fff;
  border-color: rgba(120, 80, 30, .16);
  color: var(--text);
}
body.theme-earth input:focus,
body.theme-earth textarea:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: #fffefb;
}
body.theme-earth button,
body.theme-earth .btn {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(180, 83, 9, .18), 0 8px 20px rgba(180, 83, 9, .16);
}
body.theme-earth button:hover,
body.theme-earth .btn:hover {
  background: var(--accent-hover);
  color: #fff;
}
body.theme-earth button.secondary,
body.theme-earth .btn.secondary,
body.theme-earth a.btn.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
body.theme-earth button.secondary:hover,
body.theme-earth .btn.secondary:hover {
  background: #faf4ea;
  color: var(--text);
}
body.theme-earth button.ghost,
body.theme-earth .btn.ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
body.theme-earth button.ghost:hover,
body.theme-earth .btn.ghost:hover {
  background: rgba(180, 83, 9, .06);
  color: var(--text);
}
body.theme-earth .otp-hero {
  border-color: var(--accent-border);
  background:
    radial-gradient(420px 180px at 50% 0%, rgba(217, 119, 6, .16), transparent 70%),
    linear-gradient(180deg, #fffaf0, #f5ead8);
}
body.theme-earth .otp-value {
  color: #9a3412;
  text-shadow: 0 0 28px rgba(180, 83, 9, .2);
}
body.theme-earth .otp-value.empty { color: var(--text-3); text-shadow: none; }
body.theme-earth .status-bar {
  background: #fffdf8;
  border-color: var(--line);
}
body.theme-earth .mail-card {
  background: #fffdf8;
  border-color: var(--line);
  box-shadow: var(--shadow);
}
body.theme-earth .mail-head {
  background: rgba(180, 83, 9, .05);
  border-bottom-color: var(--line);
}
body.theme-earth .mail-frame {
  background: #fff;
  border-color: var(--line);
}
body.theme-earth .msg.muted {
  background: rgba(180, 83, 9, .06);
  border-color: var(--line);
  color: var(--text-2);
}
body.theme-earth .msg.ok {
  background: rgba(180, 83, 9, .1);
  border-color: var(--accent-border);
  color: #9a3412;
}
body.theme-earth .msg.err {
  background: var(--danger-dim);
  border-color: var(--danger-border);
  color: #991b1b;
}
body.theme-earth .toast {
  background: #2c2116;
  color: #faf6ef;
  border-color: rgba(255,255,255,.08);
}
body.theme-earth .section-title .dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}
body.theme-earth a { color: #b45309; }
body.theme-earth a:hover { color: #9a3412; }
body.theme-earth ::selection {
  background: rgba(180, 83, 9, .22);
  color: #1c1410;
}

/* ── type ── */
h1,h2,h3 { letter-spacing: -.025em; line-height: 1.2; }
.section-title {
  margin: 0 0 14px;
  font-size: .92rem; font-weight: 650;
  display: flex; align-items: center; gap: 10px;
}
.section-title .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim);
}
.muted, .meta { color: var(--text-2); font-size: .875rem; word-break: break-word; }
.meta-dim { color: var(--text-3); font-size: .78rem; }

/* ── surfaces ── */
.card {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card-shell {
  padding: 4px;
  border-radius: calc(var(--radius) + 4px);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
}
.card-shell > .card { box-shadow: none; border-color: var(--line); }
.card.accent-edge {
  border-color: var(--accent-border);
  background:
    linear-gradient(180deg, rgba(212, 160, 23, .08), transparent 40%),
    linear-gradient(180deg, var(--bg-card), var(--bg-elev));
}
/* Primary action card — the page's main task (import) */
.card.card-lead {
  position: relative;
  border-color: var(--accent-border);
  box-shadow: var(--shadow), 0 0 0 1px var(--accent-border) inset;
}
.card.card-lead::before {
  content: "";
  position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), transparent);
}
body.theme-earth .card.card-lead {
  border-color: var(--accent-border);
}
/* Secondary configuration panels: worker link + view token side-by-side */
.config-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.config-row > .card { height: 100%; }
@media (max-width: 860px) {
  .config-row { grid-template-columns: 1fr; gap: 18px; }
}
.grid-2 { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-3.stats-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.grid-3.stats-row .stat-tile { padding: 10px 10px; min-width: 0; }
.grid-3.stats-row .stat-value { font-size: clamp(1.1rem, 4.5vw, 1.45rem); }
.grid-3.stats-row .stat-label { font-size: .62rem; letter-spacing: .08em; }
/* link cells: never break char-by-char */
.links-cell { min-width: 0; max-width: 280px; }
.links-cell a { white-space: nowrap; }
.links-cell .meta,
.links-cell code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
.email-cell { font-weight: 650; word-break: break-all; }
.actions-cell .row { flex-wrap: nowrap; }
@media (max-width: 960px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-3.stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .page { width: calc(100% - 24px); padding-top: 20px; }
  /* mobile table: hide long URL dumps, keep actions */
  .links-cell .meta { display: none; }
  .links-cell { max-width: 110px; }
  th:nth-child(3), td.created-cell { display: none; } /* hide Created on small screens */
  .desktop-only { display: none !important; }
  .actions-cell .btn,
  .actions-cell button { padding: 8px 10px; font-size: .8rem; }
  .row.end { justify-content: stretch; }
  .row.end > button,
  .row.end > .btn,
  .row.end > a.btn { flex: 1 1 auto; min-width: 0; }
  .grow { min-width: 0; width: 100%; }
  .modal { padding: 10px; align-items: end; }
  .modal-panel {
    width: 100%;
    max-height: min(92dvh, 900px);
    border-radius: 16px 16px 12px 12px;
  }
  .modal-head { padding: 16px 16px 14px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px 16px; }
  th, td { padding: 10px 8px; }
  .card { padding: 14px; }
}
.desktop-only { display: block; }

/* ── stats ── */
.stat-tile {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--line);
}
.stat-label {
  font-size: .68rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 6px;
}
.stat-value {
  font-size: 1.55rem; font-weight: 700; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

/* ── forms ── */
.lbl {
  display: block; font-size: .78rem; font-weight: 550;
  color: var(--text-2); margin-bottom: 8px; letter-spacing: .01em;
}
input[type=text], input[type=search], input[type=number], input[type=password], input[type=url], input[type=email], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
textarea {
  min-height: 128px; resize: vertical;
  font-family: var(--mono); font-size: .84rem; line-height: 1.55;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: #16120e;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 160px; }

/* ── buttons ── */
button, .btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: .875rem; font-weight: 600;
  letter-spacing: -.01em; line-height: 1;
  padding: 10px 14px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink, #2a1c08);
  transition: transform .15s var(--ease), background .15s var(--ease), opacity .15s, box-shadow .2s var(--ease);
  text-decoration: none; white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(212, 160, 23, .22), 0 8px 24px rgba(212, 160, 23, .14);
}
button:hover, .btn:hover { background: var(--accent-hover); color: var(--accent-ink, #2a1c08); }
button:active, .btn:active { transform: scale(.98); }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink, #2a1c08); }
button.secondary, .btn.secondary, a.btn.secondary {
  background: rgba(255,255,255,.04);
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
button.secondary:hover, .btn.secondary:hover, a.btn.secondary:hover {
  background: rgba(255,255,255,.08); color: var(--text);
}
button.ghost, .btn.ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--line-strong); box-shadow: none;
}
button.ghost:hover, .btn.ghost:hover { color: var(--text); background: rgba(255,255,255,.04); }
button.danger, .btn.danger {
  background: var(--danger-dim); color: var(--danger);
  border: 1px solid var(--danger-border); box-shadow: none;
}
button.danger:hover, .btn.danger:hover { background: rgba(251,113,133,.2); color: #fecdd3; }

/* ── messages ── */
.msg {
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: .875rem; border: 1px solid var(--line);
  background: var(--bg-card-2); color: var(--text-2);
}
.msg.ok { background: var(--accent-dim); border-color: var(--accent-border); color: #f0d78c; }
.msg.err { background: var(--danger-dim); border-color: var(--danger-border); color: #fecdd3; }
.msg.muted { background: rgba(255,255,255,.03); color: var(--text-3); }
.msg.small { font-size: .82rem; margin-top: 10px; }

/* ── table ── */
.table-wrap {
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-input);
}
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.col-check {
  width: 36px;
  text-align: center;
  vertical-align: middle;
  padding-left: 10px;
  padding-right: 6px;
}
.col-check input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #d4a24c);
  cursor: pointer;
}
th, td {
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: .7rem; font-weight: 650; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-3);
  background: rgba(255,255,255,.02);
  position: sticky; top: 0;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(255,255,255,.015); }
.pager { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

/* ── toast ── */
.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 100;
  max-width: min(400px, 92vw);
  padding: 12px 16px; border-radius: 999px;
  background: #2a2116; color: #fff8e7;
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  font-size: .875rem; font-weight: 550;
  opacity: 0; transform: translateY(12px) scale(.98);
  transition: .28s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.err { background: #3f1219; border-color: var(--danger-border); color: #fecdd3; }

/* ── modal ── */
.modal[hidden] { display: none !important; }
.modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 18px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.68);
  backdrop-filter: blur(8px);
}
.modal-panel {
  position: relative;
  display: flex; flex-direction: column;
  width: min(720px, 100%);
  max-height: min(90dvh, 900px);
  overflow: hidden;
  background: linear-gradient(180deg, #221c15 0%, #12100d 100%);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.05) inset;
  animation: modalIn .35s var(--ease);
}
.modal-panel.sm { width: min(520px, 100%); }
.modal-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.modal-head h2 {
  margin: 0;
  font-size: 1.08rem; font-weight: 700;
  letter-spacing: -.025em; color: var(--text);
}
.modal-desc {
  margin: 6px 0 0;
  font-size: .84rem; font-weight: 400;
  color: var(--text-2); line-height: 1.45;
}
.modal-body {
  padding: 18px 20px;
  overflow: auto;
  flex: 1;
}
.modal-body > .lbl:first-child { margin-top: 0; }
.modal-footer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,.18);
}
.modal-footer-stack {
  display: flex; flex-direction: column; gap: 10px;
}
.modal-footer-stack > button,
.modal-footer-stack > .btn { width: 100%; justify-content: center; }
.modal-footer-row {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end;
  align-items: center;
}
.modal-body .msg { margin-top: 0; }
.modal-body .msg + .modal-actions,
.modal-body .modal-actions { margin-top: 12px; }
.modal-body .msg + .lbl { margin-top: 14px; }
.modal-panel .lbl {
  color: var(--text);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .02em;
}
.lbl-hint { font-weight: 450; color: var(--text-3); }
.input-compact {
  max-width: 180px;
  font-size: 1.05rem; font-weight: 650;
  font-variant-numeric: tabular-nums;
  padding: 10px 14px;
}
.modal-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin: 12px 0; }
.modal-field { flex: 1; min-width: 140px; }
.modal-toggle {
  display: flex; gap: 8px; align-items: center;
  color: var(--text-2); font-size: .9rem; padding-bottom: 10px;
}
.modal-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* ── login ── */
.login-page {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px;
  position: relative; overflow: hidden;
}
.login-page::before {
  content: "";
  position: absolute; inset: -20%;
  background:
    radial-gradient(600px 400px at 20% 20%, rgba(212, 160, 23, .18), transparent 60%),
    radial-gradient(500px 360px at 80% 70%, rgba(161, 98, 7, .12), transparent 55%);
  pointer-events: none;
}
.login-card {
  position: relative; width: min(400px, 100%);
  padding: 6px;
  border-radius: 24px;
  background: rgba(245, 210, 150, .05);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(20, 12, 4, .55);
}
.login-inner {
  background: linear-gradient(180deg, #1c1812, #100e0b);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 28px;
}
.login-inner h1 {
  margin: 0 0 8px; font-size: 1.45rem; font-weight: 700; letter-spacing: -.03em;
}
.login-inner .lead { margin: 0 0 24px; color: var(--text-2); font-size: .92rem; }
.login-inner button { width: 100%; margin-top: 16px; padding: 13px 16px; }

/* ── mail / otp viewer ── */
.otp-hero {
  text-align: center;
  padding: 28px 20px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--accent-border);
  background:
    radial-gradient(500px 200px at 50% 0%, rgba(212, 160, 23, .16), transparent 70%),
    linear-gradient(180deg, var(--bg-card), var(--bg-elev));
  box-shadow: var(--shadow);
}
.otp-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 10px;
}
.otp-value {
  font-family: var(--mono);
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 700; letter-spacing: .22em;
  color: var(--accent);
  min-height: 1.15em;
  user-select: all;
  text-shadow: 0 0 40px rgba(212, 160, 23, .28);
}
.otp-value.empty {
  color: var(--text-3); letter-spacing: 0;
  font-size: 1.05rem; font-weight: 550; font-family: var(--font);
}
.status-bar {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--line);
  font-size: .84rem;
}
.status-bar .label {
  color: var(--text-3); font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; margin-right: 6px;
}
.mail-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-card); overflow: hidden; box-shadow: var(--shadow);
}
.mail-head {
  display: grid; grid-template-columns: minmax(0,1fr) auto;
  gap: 12px; align-items: start;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.015);
}
.mail-head h2 { margin: 0; font-size: .98rem; font-weight: 650; letter-spacing: -.02em; }
.mail-date { color: var(--text-3); font-size: .78rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.mail-frame {
  width: 100%; border: 0; display: block; background: #fff;
  height: min(480px, calc(100dvh - 320px)); min-height: 260px;
}
.mail-empty {
  padding: 40px 20px; text-align: center; color: var(--text-3);
}
.mail-empty strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 1rem; }
.messages { display: grid; gap: 14px; }

/* ── utilities ── */
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 600;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid var(--accent-border);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
