/* Sign-in and account pages. Same palette as the terminal (app.css). */
:root {
  --bg: #0b0e14;
  --panel: #131722;
  --panel-2: #1a1f2b;
  --border: #2a2e39;
  --border-strong: #363a45;
  --text: #d1d4dc;
  --text-strong: #f0f3fa;
  --muted: #787b86;
  --accent: #2962ff;
  --accent-hover: #1e53e5;
  --up: #089981;
  --down: #f23645;
  --warn: #d4a514;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: #5b8cff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- sign-in layout ---------- */
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr); min-height: 100vh; }
.brand-side {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: radial-gradient(1200px 600px at 20% 10%, rgba(41, 98, 255, 0.10), transparent 60%), var(--panel);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.brand-side svg.chart { position: absolute; inset: auto 0 0 0; width: 100%; height: 62%; opacity: 0.9; }
.logo { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2962ff, #089981);
  color: #fff; font-weight: 700; font-size: 16px;
}
.logo-name { font-size: 17px; font-weight: 600; color: var(--text-strong); letter-spacing: 0.2px; }
.brand-copy { position: relative; z-index: 1; max-width: 440px; }
.brand-copy h2 { margin: 0 0 10px; font-size: 28px; line-height: 1.25; font-weight: 600; color: var(--text-strong); letter-spacing: -0.3px; }
.brand-copy p { margin: 0; color: var(--muted); font-size: 15px; }
.ticker {
  position: relative; z-index: 1;
  display: flex; gap: 28px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
}
.ticker b { color: var(--text); font-weight: 600; margin-right: 6px; }
.ticker .up { color: var(--up); }
.ticker .down { color: var(--down); }

.form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.card { width: 100%; max-width: 380px; }
.card h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; color: var(--text-strong); letter-spacing: -0.2px; }
.card .sub { margin: 0 0 28px; color: var(--muted); }

.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 500; color: var(--text); letter-spacing: 0.2px; }
.input-wrap { position: relative; }
input[type="text"], input[type="password"], input[type="email"] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text-strong);
  font: 15px var(--sans);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.22); }
input[aria-invalid="true"] { border-color: var(--down); }
.input-wrap input { padding-right: 64px; }
.reveal {
  position: absolute; right: 6px; top: 6px; height: 32px; padding: 0 10px;
  border: 0; border-radius: 4px; background: transparent; color: var(--muted);
  font: 500 12px var(--sans); cursor: pointer;
}
.reveal:hover { color: var(--text); background: var(--panel-2); }
input.code {
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: 12px;
  text-align: center;
  height: 56px;
  padding: 0 0 0 12px;
}
input.code.recovery { font-size: 18px; letter-spacing: 3px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 6px;
  font: 600 14px var(--sans); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn-primary { width: 100%; background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--panel-2); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { border-color: #4a4f5c; }
.btn-danger { background: transparent; color: var(--down); border-color: rgba(242, 54, 69, 0.45); }
.btn-danger:hover:not(:disabled) { background: rgba(242, 54, 69, 0.08); }
.btn:disabled { opacity: 0.6; cursor: default; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert {
  margin: 0 0 18px; padding: 10px 12px; border-radius: 6px;
  font-size: 13px; line-height: 1.45;
  border: 1px solid rgba(242, 54, 69, 0.4); background: rgba(242, 54, 69, 0.08); color: #ff8a93;
}
.alert.info { border-color: rgba(41, 98, 255, 0.4); background: rgba(41, 98, 255, 0.08); color: #9db8ff; }
.alert.ok { border-color: rgba(8, 153, 129, 0.45); background: rgba(8, 153, 129, 0.08); color: #4fd1b5; }
.alert.warn { border-color: rgba(212, 165, 20, 0.45); background: rgba(212, 165, 20, 0.08); color: #f0c94b; }

.linkish { background: none; border: 0; padding: 0; color: #5b8cff; font: inherit; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.row-between { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; font-size: 13px; }
.foot { margin-top: 40px; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.foot svg { flex: none; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .brand-side { min-height: 200px; padding: 24px 20px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand-copy, .ticker { display: none; }
  .brand-side svg.chart { height: 100%; opacity: 0.45; }
  .form-side { padding: 32px 16px 48px; align-items: flex-start; }
}

/* ---------- account page ---------- */
.topbar {
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.topbar nav { display: flex; gap: 8px; align-items: center; }
.page { max-width: 860px; margin: 0 auto; padding: 32px 24px 64px; }
.page h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; color: var(--text-strong); }
.page .sub { margin: 0 0 28px; color: var(--muted); }
.panel { border: 1px solid var(--border); border-radius: 8px; background: var(--panel); margin-bottom: 20px; }
.panel-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-strong); }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.panel-body { padding: 20px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.on { color: #4fd1b5; background: rgba(8, 153, 129, 0.12); }
.badge.off { color: #f0c94b; background: rgba(212, 165, 20, 0.12); }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { width: auto; }
.setup { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
.qr { width: 200px; height: 200px; border-radius: 8px; background: #fff; padding: 10px; display: grid; place-items: center; }
.qr img { width: 180px; height: 180px; image-rendering: pixelated; }
.secret { font-family: var(--mono); font-size: 14px; letter-spacing: 1.5px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; word-break: break-all; color: var(--text-strong); user-select: all; }
ol.steps { margin: 0 0 16px; padding-left: 20px; color: var(--text); }
ol.steps li { margin-bottom: 6px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; font-family: var(--mono); font-size: 15px; color: var(--text-strong); background: var(--bg); border: 1px dashed var(--border-strong); border-radius: 8px; padding: 16px 20px; margin: 12px 0 16px; }
table.sessions { width: 100%; border-collapse: collapse; font-size: 13px; }
table.sessions th { text-align: left; font-weight: 500; color: var(--muted); padding: 0 12px 10px 0; border-bottom: 1px solid var(--border); }
table.sessions td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.sessions tr:last-child td { border-bottom: 0; }
.ua { color: var(--text-strong); }
.dim { color: var(--muted); font-size: 12px; }
.tag { font-size: 11px; font-weight: 600; color: #4fd1b5; background: rgba(8, 153, 129, 0.12); padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
.dialog-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; padding: 16px; z-index: 10; }
.dialog { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 10px; padding: 24px; }
.dialog h3 { margin: 0 0 6px; font-size: 17px; color: var(--text-strong); }
.dialog p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
@media (max-width: 700px) {
  .form-grid, .setup { grid-template-columns: 1fr; }
  .page { padding: 24px 16px 48px; }
  .topbar { padding: 0 16px; }
  .codes { grid-template-columns: 1fr; }
  table.sessions .hide-sm { display: none; }
}
