/* VoxaDent - dark theme. Simple, large, high-contrast (WCAG AA). System fonts only (no external fonts). */
:root {
  color-scheme: dark;
  --bg: #0B0B10;          /* page */
  --card: #15151C;        /* panels */
  --field: #1E1E28;       /* inputs / text areas (slightly lighter) */
  --text: #EDEDF3;
  --muted: #B3B0C4;
  --line: #34344A;
  --line-strong: #6B6987;  /* 3:1+ against panels, for field/button outlines */
  --violet: #741DFF; --magenta: #F701D0;
  --grad: linear-gradient(90deg, #F701D0, #741DFF);
  --focus: #C9A8FF;
  --rec: #FF5A5F;         /* recording / errors (text-safe red on dark) */
  --rec-solid: #E5383B;
  --ok: #6EE7A0; --ok-bg: #0E2A1C; --ok-line: #1F5E3D;
  --warn: #FFD27A; --warn-bg: #2B2110; --warn-line: #6B5020;
  --mark-bg: #FFD54F; --mark-text: #15151C;
  --chg-bg: #2A1F45; --chg-line: #C9A8FF;  /* lines changed from the template */
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 18px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }

.topbar { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; background: var(--card); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--grad); }
.brand { display: flex; align-items: center; }
.brand-logo { height: 42px; width: auto; display: block; }
.login-logo { display: block; width: 260px; max-width: 80%; height: auto; margin: -10px auto 4px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.who { color: var(--muted); font-size: 16px; }

main { max-width: 1400px; margin: 0 auto; padding: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; }
.narrow { max-width: 480px; margin: 40px auto; }
.narrow h1 { text-align: center; }
h1 { margin-top: 0; font-size: 28px; }
h2 { margin: 0; font-size: 20px; }
a { color: var(--focus); }

label { display: block; font-weight: 600; margin-bottom: 14px; }
input, select { display: block; width: 100%; margin-top: 6px; padding: 12px; font: inherit; color: var(--text); border: 2px solid var(--line-strong); border-radius: 8px; background: var(--field); }
select option { background: var(--field); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--violet); }
input.code { font-size: 28px; letter-spacing: 6px; text-align: center; }
::placeholder { color: #8E8BA3; }

.btn { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; border: 2px solid var(--line-strong); background: var(--field); color: var(--text); cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--focus); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* Gradient buttons use bold 19px+ text so white text meets WCAG AA for large text on the magenta end. */
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; font-weight: 700; font-size: 20px; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-big { font-size: 20px; padding: 14px 24px; }
form .btn-big { width: 100%; }
.btn-record { font-size: 26px; font-weight: 700; padding: 18px 40px; min-width: 260px; background: var(--grad); border-color: transparent; color: #fff; border-radius: 999px; box-shadow: 0 4px 22px rgba(247, 1, 208, .28); }
.btn-record:hover:not(:disabled) { filter: brightness(1.1); border-color: transparent; }
.btn-record.recording { background: transparent; border-color: var(--rec); color: var(--rec); box-shadow: 0 0 0 4px rgba(255, 90, 95, .18); }

.msg { margin: 10px 0 0; }
.msg:empty { display: none; }
.error { color: var(--rec); font-weight: 600; }
.notice { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); padding: 8px 12px; border-radius: 8px; }

.steps { padding-left: 22px; }
.qr { display: flex; justify-content: center; margin: 10px 0; }
/* White tile so phone cameras can scan the QR code */
.qr img { width: 240px; height: 240px; padding: 14px; background: #fff; border-radius: 10px; }
.secret { display: block; word-break: break-all; font-size: 16px; padding: 8px; background: var(--field); color: var(--text); border-radius: 6px; margin-top: 6px; }
summary { cursor: pointer; color: var(--muted); }

.pickers { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.pickers label { flex: 1 1 300px; margin-bottom: 0; }
.recorder { display: flex; align-items: center; gap: 24px; margin-top: 20px; flex-wrap: wrap; }
.rec-indicator { font-size: 22px; font-weight: 700; color: var(--rec); display: flex; align-items: center; gap: 10px; }
.dot { width: 18px; height: 18px; border-radius: 50%; background: var(--rec-solid); box-shadow: 0 0 10px var(--rec-solid); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.status { font-size: 18px; color: var(--muted); }

.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .panes { grid-template-columns: 1fr; } }
.pane { display: flex; flex-direction: column; margin-bottom: 0; }
.pane-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
textarea { width: 100%; min-height: 460px; resize: vertical; padding: 12px; font: 17px/1.5 Consolas, "Cascadia Mono", monospace; color: var(--text); background: var(--field); border: 2px solid var(--line-strong); border-radius: 8px; }
.marked { margin-top: 10px; padding: 12px; border: 2px dashed var(--warn-line); background: var(--warn-bg); color: var(--text); border-radius: 8px; white-space: pre-wrap; font: 16px/1.5 Consolas, "Cascadia Mono", monospace; max-height: 300px; overflow: auto; }
.marked::before { content: "Numbers to check are highlighted:"; display: block; font: 600 14px "Segoe UI", system-ui, sans-serif; color: var(--warn); margin-bottom: 6px; }
mark { background: var(--mark-bg); color: var(--mark-text); padding: 0 2px; border-radius: 3px; font-weight: 700; }

.numcheck { margin-top: 18px; }
.numcheck-summary { font-size: 20px; font-weight: 700; padding: 12px 16px; border-radius: 8px; }
.numcheck-summary.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-line); }
.numcheck-summary.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
#numcheck-list { color: var(--text); }
.small { font-size: 14px; color: var(--muted); }
.bottom-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ---- Template used / changes from template / review list ---- */
.tpl-used { margin: 0 0 10px; padding: 6px 10px; border-left: 4px solid var(--violet); background: var(--field); border-radius: 4px; font-size: 16px; color: var(--text); }
#template-pick { margin: 0 0 10px; }
.changes { margin-top: 14px; }
.changes h3 { margin: 0 0 4px; font-size: 18px; }
.legend { margin: 0 0 8px; }
.changes-view { background: var(--field); border: 2px solid var(--line-strong); border-radius: 8px; padding: 8px 0; font: 15px/1.5 Consolas, "Cascadia Mono", monospace; max-height: 420px; overflow: auto; }
.chg-line { padding: 1px 12px; white-space: pre-wrap; border-left: 4px solid transparent; }
.chg-same { color: var(--muted); }
.chg-edited, .chg-added, .chg-filled { background: var(--chg-bg); color: var(--text); border-left-color: var(--chg-line); }
.chg-badge { display: inline-block; font: 700 12px/1.6 "Segoe UI", system-ui, sans-serif; background: var(--chg-line); color: #15151C; padding: 0 6px; border-radius: 4px; vertical-align: 1px; }
.chg-was { color: var(--muted); font-size: 13px; padding-left: 4px; }
.removed-list { margin: 6px 0 0; padding-left: 22px; font: 15px/1.5 Consolas, "Cascadia Mono", monospace; color: var(--text); }
.removed-list li::marker { content: "− "; color: var(--rec); }
#removed-box { margin-top: 10px; }
#removed-box summary { color: var(--text); font-weight: 600; }

.review { border-color: var(--warn-line); }
.review h2 { color: var(--warn); }
.review-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.review-item { background: var(--field); border: 1px solid var(--line); border-left: 5px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; }
.review-hard { border-left-color: var(--warn); }
.review-line { font: 15px/1.5 Consolas, "Cascadia Mono", monospace; white-space: pre-wrap; }
.review-why { font-size: 14px; color: var(--muted); margin: 4px 0 8px; }
.review-hard .review-why { color: var(--warn); }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.review-actions .btn { padding: 6px 14px; font-size: 16px; }

/* ---- Abbreviations editor ---- */
.abbr { margin-top: 18px; }
.abbr > summary { list-style: none; display: flex; align-items: center; gap: 10px; color: var(--text); }
.abbr > summary::-webkit-details-marker { display: none; }
.abbr > summary::before { content: "▸"; color: var(--focus); font-size: 18px; }
.abbr[open] > summary::before { content: "▾"; }
.abbr-title { display: inline; }
.abbr-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.abbr-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.abbr-short { font: 700 16px/1.4 Consolas, "Cascadia Mono", monospace; min-width: 90px; color: var(--text); }
.abbr-meaning { flex: 1 1 240px; color: var(--text); }
.abbr-tag { font-size: 13px; color: var(--muted); }
.abbr-row .btn { padding: 4px 12px; font-size: 15px; }
.abbr-row input { margin-top: 0; padding: 6px 8px; width: auto; flex: 1 1 160px; }
.abbr-row input.abbr-short-input { flex: 0 1 120px; font-family: Consolas, "Cascadia Mono", monospace; }
.abbr-add { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.abbr-add label { flex: 1 1 200px; margin-bottom: 0; }
.abbr-add label:first-child { flex: 0 1 160px; }
.abbr-bulk { margin-top: 14px; }
.abbr-bulk textarea { min-height: 150px; margin-top: 6px; }
#abbr-status:not(:empty) { color: var(--ok); font-weight: 600; }
