/* ============================================================
   Vela — sign-in console
   Design tokens
   ============================================================ */
:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-alt: #f5f5f7;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-press: #005fc4;
  --border: #d2d2d7;
  --border-strong: #b8b8bd;
  --error: #ff3b30;
  --error-bg: #fff1f0;
  --success: #30d158;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 24px 48px -12px rgba(0,0,0,0.14);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-text);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

::selection { background: rgba(0,113,227,0.18); }

/* ============================================================
   Ambient background — faint topographic contour field
   ============================================================ */
.bg-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}

.bg-field::before {
  content: "";
  position: absolute;
  inset: -10%;
  background-image:
    radial-gradient(circle at 22% 28%, rgba(0,113,227,0.09), transparent 42%),
    radial-gradient(circle at 78% 18%, rgba(120,90,230,0.07), transparent 40%),
    radial-gradient(circle at 62% 78%, rgba(0,113,227,0.06), transparent 45%);
  filter: blur(40px);
  animation: driftField 34s ease-in-out infinite alternate;
}

.bg-field svg.contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

@keyframes driftField {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(-2%, 1.5%, 0) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-field::before { animation: none; }
}

/* ============================================================
   Layout shell
   ============================================================ */
.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 56px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
}

.brand .logo { width: 22px; height: 22px; }
.brand span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.topbar nav {
  display: flex;
  gap: 28px;
}

.topbar nav a {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.15s var(--ease);
}
.topbar nav a:hover { color: var(--text); }

main.stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 20px 64px;
}

/* ============================================================
   Auth card
   ============================================================ */
.auth-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card {
  width: 100%;
  background: var(--surface);
  border: 1px solid rgba(210,210,215,0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px 36px 32px;
  position: relative;
  overflow: hidden;
}

.card-glyph {
  width: 46px;
  height: 46px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--surface-alt);
  color: var(--text);
}
.card-glyph svg { width: 24px; height: 24px; }

.card h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-align: center;
  margin: 0 0 6px;
}

.card p.sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13.5px;
  margin: 0 0 28px;
  line-height: 1.5;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 590;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}

.field input {
  width: 100%;
  font-family: var(--font-text);
  font-size: 15px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.field input::placeholder { color: var(--text-tertiary); }

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(0,113,227,0.14);
}

.field.has-error input {
  border-color: var(--error);
}
.field.has-error input:focus {
  box-shadow: 0 0 0 3.5px rgba(255,59,48,0.13);
}

.field-error {
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--error);
  font-size: 12.5px;
  margin-top: 7px;
  animation: shake 0.32s var(--ease);
}
.field.has-error .field-error { display: flex; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(1px); }
}

.banner {
  display: none;
  align-items: flex-start;
  gap: 9px;
  background: var(--error-bg);
  border: 1px solid rgba(255,59,48,0.18);
  color: #c9261b;
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.banner.show { display: flex; }
.banner svg { flex-shrink: 0; margin-top: 1px; }

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 20px;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
  cursor: pointer;
}
.checkbox-line input { accent-color: var(--accent); width: 14px; height: 14px; }

.link-muted {
  font-size: 13px;
  color: var(--accent);
}
.link-muted:hover { text-decoration: underline; }

button.primary {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 590;
  cursor: pointer;
  position: relative;
  transition: background 0.15s var(--ease), transform 0.1s var(--ease);
}
button.primary:hover { background: var(--accent-hover); }
button.primary:active { background: var(--accent-press); transform: scale(0.99); }
button.primary:disabled {
  background: var(--border);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

button.primary .spinner {
  display: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -8.5px 0 0 -8.5px;
}
button.primary.loading .btn-label { opacity: 0; }
button.primary.loading .spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

.divider-text {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
  margin: 22px 0 16px;
  position: relative;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-text);
}
.back-link:hover { color: var(--text); }

.mfa-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 18px;
  font-family: var(--font-mono);
}
.mfa-meta .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

.attempts-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 14px;
}

/* step transition */
.step { animation: fadeSlide 0.28s var(--ease); }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.footnote {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.6;
}
.footnote a { color: var(--text-secondary); }
.footnote a:hover { color: var(--text); text-decoration: underline; }

/* ============================================================
   Status ticker (signature element)
   ============================================================ */
.status-strip {
  width: 100%;
  max-width: 400px;
  margin-top: 18px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(210,210,215,0.6);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-family: var(--font-mono);
}

.status-strip .status-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}
.status-strip .status-head .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(48,209,88,0.16);
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 14px;
}

.region-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-tertiary);
}
.region-row .rid { color: var(--text-secondary); }
.region-row .lat { font-variant-numeric: tabular-nums; transition: color 0.2s; }
.region-row .lat.pulse { color: var(--accent); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 18px clamp(20px, 5vw, 56px) 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-tertiary);
}
.site-footer .flinks { display: flex; gap: 18px; }
.site-footer a:hover { color: var(--text-secondary); }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: rgba(29,29,31,0.92);
  color: #fff;
  font-size: 13px;
  padding: 11px 18px;
  border-radius: 980px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  z-index: 20;
  max-width: 86vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 520px) {
  .topbar nav { display: none; }
  .card { padding: 32px 22px 26px; }
  .site-footer { flex-direction: column; gap: 10px; text-align: center; }
}

/* ============================================================
   Status page
   ============================================================ */
.status-page {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 20px 40px;
}

.status-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid rgba(210,210,215,0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
  margin-bottom: 28px;
}
.status-hero .big-dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(48,209,88,0.14);
  flex-shrink: 0;
}
.status-hero h1 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.status-hero p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.service-block {
  background: var(--surface);
  border: 1px solid rgba(210,210,215,0.6);
  border-radius: var(--radius-md);
  padding: 4px 20px;
  margin-bottom: 22px;
}

.service-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--surface-alt);
}
.service-row:last-child { border-bottom: none; }
.service-row .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.service-row .name { font-size: 13.5px; font-weight: 500; }
.service-row .state { margin-left: auto; font-size: 12px; color: var(--text-tertiary); }
.service-row .uptime-bars {
  display: flex;
  gap: 2px;
  width: 100%;
  margin-top: 8px;
  flex-basis: 100%;
}
.service-row .uptime-bars i {
  flex: 1;
  height: 20px;
  border-radius: 2px;
  background: var(--success);
  opacity: 0.85;
}
.service-row .uptime-bars i.dip { background: #ffd60a; opacity: 0.9; }
.service-row-inner { display: flex; align-items: center; gap: 12px; width: 100%; flex-wrap: wrap; }
.service-row .uptime-label {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 2px 12px;
}

.incident-item {
  background: var(--surface);
  border: 1px solid rgba(210,210,215,0.6);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 10px;
}
.incident-item .i-title { font-size: 13.5px; font-weight: 500; margin-bottom: 3px; }
.incident-item .i-meta { font-size: 12px; color: var(--text-tertiary); }
.incident-item .i-body { font-size: 12.5px; color: var(--text-secondary); margin-top: 8px; line-height: 1.55; }

/* ============================================================
   Marketing site (root)
   ============================================================ */
.topbar.marketing nav { gap: 32px; align-items: center; }
.btn-pill {
  padding: 8px 16px;
  border-radius: 980px;
  background: var(--accent);
  color: #fff !important;
  font-size: 13px;
  font-weight: 590;
  transition: background 0.15s var(--ease);
}
.btn-pill:hover { background: var(--accent-hover); }

.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 88px 20px 40px;
  text-align: center;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(0,113,227,0.08);
  padding: 6px 13px;
  border-radius: 980px;
  margin-bottom: 22px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0 0 18px;
}
.hero p.lead {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 560px;
  margin: 0 auto 34px;
}
.hero .cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-lg {
  padding: 13px 26px;
  border-radius: 980px;
  font-size: 15px;
  font-weight: 590;
  transition: all 0.15s var(--ease);
}
.btn-lg.solid { background: var(--accent); color: #fff !important; }
.btn-lg.solid:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-lg.ghost { background: var(--surface-alt); color: var(--text) !important; }
.btn-lg.ghost:hover { background: var(--border); }

.hero-shot {
  max-width: 960px;
  margin: 56px auto 0;
  padding: 0 20px;
}
.hero-shot .frame {
  background: var(--surface);
  border: 1px solid rgba(210,210,215,0.6);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  padding: 14px;
}
.hero-shot .frame-inner {
  background: var(--surface-alt);
  border-radius: 14px;
  padding: 28px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-secondary);
  text-align: left;
  overflow: hidden;
}
.hero-shot .frame-inner .dots { display: flex; gap: 6px; margin-bottom: 16px; }
.hero-shot .frame-inner .dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.hero-shot pre { margin: 0; white-space: pre-wrap; line-height: 1.7; }
.hero-shot .tok-cmd { color: var(--accent); }
.hero-shot .tok-ok { color: var(--success); }
.hero-shot .tok-dim { color: var(--text-tertiary); }

.section {
  max-width: 1040px;
  margin: 0 auto;
  padding: 88px 20px;
}
.section-heading { text-align: center; max-width: 600px; margin: 0 auto 48px; }
.section-heading h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.section-heading p { color: var(--text-secondary); font-size: 15.5px; margin: 0; line-height: 1.55; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid rgba(210,210,215,0.6);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.feature-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.feature-card .ic {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--surface-alt);
  color: var(--accent);
  margin-bottom: 16px;
}
.feature-card .ic svg { width: 19px; height: 19px; }
.feature-card h3 { font-size: 15.5px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.005em; }
.feature-card p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; margin: 0; }

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  background: var(--surface-alt);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
}
.stat { text-align: center; }
.stat .n {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.stat .l { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

.logo-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 36px;
  padding: 0 20px;
}
.logo-strip span {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text-tertiary);
  opacity: 0.75;
}

.cta-banner {
  max-width: 1040px;
  margin: 0 auto 88px;
  padding: 52px 20px;
  text-align: center;
  background: linear-gradient(135deg, #1d1d1f, #2c2c2e);
  border-radius: 28px;
  color: #fff;
}
.cta-banner h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.cta-banner p { color: rgba(255,255,255,0.65); margin: 0 0 26px; font-size: 14.5px; }
.cta-banner .btn-lg.solid { background: #fff; color: #1d1d1f !important; }
.cta-banner .btn-lg.solid:hover { background: #f2f2f4; }

.big-footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px 40px;
}
.big-footer .cols {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--surface-alt);
}
.big-footer .col h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
}
.big-footer .col a {
  display: block;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.big-footer .col a:hover { color: var(--text); }
.big-footer .bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 700px) {
  .big-footer .cols { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Theme transitions + dark mode
   ============================================================ */
* {
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

[data-theme="dark"] {
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-alt: #2c2c2e;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #8e8e93;
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --accent-press: #0060df;
  --border: #38383a;
  --border-strong: #48484a;
  --error: #ff453a;
  --error-bg: rgba(255,69,58,0.14);
  --success: #32d74b;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.7), 0 24px 48px -12px rgba(0,0,0,0.6);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.55);
}

/* topographic background paths pick up theme color via CSS instead of
   the inline presentation attributes baked into the markup */
.bg-field svg path[stroke="#0071e3"] { stroke: var(--accent); }
.bg-field svg path[stroke="#1d1d1f"] { stroke: var(--text); }
[data-theme="dark"] .bg-field svg path { stroke-opacity: 0.12; }

[data-theme="dark"] .status-strip {
  background: rgba(28,28,30,0.7);
  border-color: rgba(56,56,58,0.7);
}
[data-theme="dark"] .search-modal { background: rgba(0,0,0,0.55); }
[data-theme="dark"] .banner { color: #ff8078; }
[data-theme="dark"] .cta-banner { background: linear-gradient(135deg, #2c2c2e, #1c1c1e); }
[data-theme="dark"] .service-row .uptime-bars i.dip { background: #ffd60a; }

/* ============================================================
   Topbar controls — theme toggle + language switcher
   ============================================================ */
.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
}

.theme-toggle {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-alt);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--border); color: var(--text); }
.theme-toggle svg { width: 16px; height: 16px; display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.lang-switch { position: relative; display: inline-flex; align-items: center; }
.lang-switch select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-alt);
  border: 1px solid transparent;
  border-radius: 980px;
  padding: 7px 24px 7px 13px;
  font-size: 12.5px;
  font-weight: 590;
  font-family: var(--font-text);
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
}
.lang-switch select:hover { background: var(--border); }
.lang-switch select:focus { box-shadow: 0 0 0 3px rgba(0,113,227,0.16); }
.lang-switch::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--text-tertiary);
  border-bottom: 1.5px solid var(--text-tertiary);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

/* hide body until theme + translations are applied, to avoid a
   flash of the wrong theme or untranslated text */
html:not([data-i18n-ready]) body { visibility: hidden; }
