/*
 * ThreVox store - static configurator, no framework, no build step.
 * Tokens mirror Web/landing/styles.css and docs/design/ui-design-system.md
 * (dark industrial, flat, no gradients).
 */

:root {
  --bg: #0b0d12;
  --surface: #141821;
  --surface-2: #1c2230;
  --border: #2a3242;
  --text: #f4f6fb;
  --muted: #99a2b5;
  --primary: #6d5ef6;
  --primary-600: #5a4be6;
  --primary-400: #8b7dff;
  --live: #22d3a6;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f5556b;
  --info: #38bdf8;

  --radius: 8px;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Barlow Semi Condensed", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--primary); color: #fff; }

:focus-visible {
  outline: 2px solid var(--primary-400);
  outline-offset: 2px;
  border-radius: 2px;
}

a { color: var(--primary-400); }

.topline { height: 3px; background: var(--primary); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.header-actions { display: flex; align-items: center; gap: 10px; }
.account { display: flex; align-items: center; gap: 10px; }
.account-name {
  font: 500 13px/1 var(--font-mono);
  color: var(--muted);
  /* An address is longer than a header has room for; truncate rather than
     pushing the rest of the row off the page on a narrow screen. */
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-quiet { padding: 8px 12px; font-size: 13px; background: transparent; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon-btn {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover,
.lang-menu[open] > .icon-btn {
  color: var(--text);
  background: var(--surface-2);
}

/* Same menu as the landing header: a <details> with the language glyph as
   its only label, each language named in itself. i18n.js marks the current
   one and closes the menu on an outside click or Escape. */
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; }
.lang-menu > summary::-webkit-details-marker { display: none; }

.lang-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 168px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.lang-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font: 500 14px var(--font-sans);
  text-align: left;
  cursor: pointer;
}

.lang-list button:hover { background: var(--surface); }

.lang-list button::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
}

.lang-list button[aria-current="true"]::before {
  background-color: var(--primary-400);
  -webkit-mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

/* A client secret is long and must be copied character-perfect: monospace,
   and wrapping rather than a horizontal scrollbar that hides half of it. */
.credentials {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  font: 400 13px/1.6 var(--font-mono);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark, .brand-wordmark { flex: none; }
.brand-chip {
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 6px;
}

.page-head { padding: 48px 0 24px; }
.kicker {
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 0 0 12px;
}
.kicker b { color: var(--primary-400); font-weight: 500; }
h1 { font: 600 40px/1.1 var(--font-display); margin: 0 0 12px; letter-spacing: -0.01em; }
h2 { font: 600 22px/1.2 var(--font-display); margin: 0 0 4px; }
.lede { color: var(--muted); max-width: 62ch; margin: 0; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 32px;
  align-items: start;
  padding-bottom: 80px;
}

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}

.step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px;
  margin-bottom: 20px;
}

.step-num {
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.14em;
  color: var(--primary-400);
  display: block;
  margin-bottom: 8px;
}

.step-note { color: var(--muted); font-size: 14px; margin: 4px 0 16px; }

label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }

select, input[type="email"], input[type="number"] {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font: 400 15px/1.2 var(--font-sans);
}

input[type="number"] { font-variant-numeric: tabular-nums; width: 96px; }

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.tier-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px;
  cursor: pointer;
  display: block;
}

.tier-card:has(input:checked) {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.tier-card input { position: absolute; opacity: 0; pointer-events: none; }
.tier-card h3 { font: 600 16px/1.2 var(--font-display); margin: 0 0 4px; }
.tier-price { font: 500 14px/1 var(--font-mono); color: var(--live); margin: 0 0 10px; }
.tier-price small { color: var(--muted); font-weight: 400; }
.tier-card ul { margin: 0; padding-left: 16px; color: var(--muted); font-size: 13px; }
.tier-note { margin: 0 0 8px; color: var(--text); font-size: 13px; }

.preset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.preset-label { color: var(--muted); font-size: 13px; }
.preset {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  cursor: pointer;
}
.preset:hover, .preset:focus-visible { border-color: var(--primary); }

.line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.line:last-child { border-bottom: 0; }
.line-name { font-weight: 500; }
.line-meta { color: var(--muted); font-size: 13px; }
.line-price { font: 500 14px/1 var(--font-mono); color: var(--muted); white-space: nowrap; }

.module {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.module:last-child { border-bottom: 0; }
.module input { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; }
.module-body { flex: 1; }
.module-name { font-weight: 500; }
.module-meta { color: var(--muted); font-size: 13px; }

.summary {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px;
  position: sticky;
  top: 88px;
}

.summary h2 { margin-bottom: 16px; }

.sum-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding: 6px 0;
  color: var(--muted);
}
.sum-line span:last-child { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); }
.sum-line.discount span:last-child { color: var(--live); }

.sum-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 12px;
  font-weight: 600;
}
.sum-total span:last-child { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.tax-note, .compliance-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 12px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font: 500 15px/1 var(--font-sans);
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-primary:disabled { background: var(--surface-2); border-color: var(--border); color: var(--muted); cursor: not-allowed; }
.btn-block { width: 100%; margin-top: 16px; }

.violations {
  border: 1px solid var(--danger);
  border-radius: 6px;
  background: rgba(245, 85, 107, 0.08);
  padding: 12px 14px;
  margin-top: 16px;
}
.violations ul { margin: 0; padding-left: 18px; font-size: 14px; }

.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: 6px;
  background: var(--surface-2);
  padding: 14px 16px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}
.notice strong { color: var(--text); font-weight: 600; }

.hidden { display: none !important; }

.volume-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}
.volume-table th, .volume-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.volume-table td:last-child { font-family: var(--font-mono); color: var(--live); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--muted);
  font-size: 13px;
}
.site-footer a { color: var(--muted); margin-right: 16px; }
