/* Mock Interview — warm paper, ink navy, a little ceremony. */

:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --ink: #22304a;
  --ink-soft: #5b6779;
  --line: #e3ddd0;
  --accent: #1f3a66;
  --accent-ink: #f6f3ec;
  --accent-soft: #e8edf6;
  --record: #b9472e;
  --good: #2e6b4f;
  --warn: #a33d2a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(34, 48, 74, 0.06), 0 8px 24px rgba(34, 48, 74, 0.07);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171d;
    --surface: #1c2028;
    --ink: #e8e6df;
    --ink-soft: #9aa3b2;
    --line: #2d333e;
    --accent: #8fb0e8;
    --accent-ink: #14171d;
    --accent-soft: #232b3a;
    --record: #e07a5f;
    --good: #7cc4a0;
    --warn: #e8917c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.screen {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px 72px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- masthead ---------- */

.masthead { text-align: center; margin-bottom: 4px; }

.masthead h1 {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 6px;
}

.tagline { color: var(--ink-soft); margin: 0; }

/* ---------- panels & fields ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.panel-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.muted { color: var(--ink-soft); font-weight: 500; text-transform: none; letter-spacing: 0; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; }

input[type="password"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field-note { font-size: 0.83rem; color: var(--ink-soft); margin: 8px 0 0; }
.field-note.error { color: var(--warn); }
.field-warning { font-size: 0.85rem; color: var(--warn); margin: 10px 0 0; }

/* ---------- category cards ---------- */

.category-list { display: flex; flex-direction: column; gap: 10px; }

.category-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.category-card .check {
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink-soft);
  border-radius: 7px;
  position: relative;
  transition: all 0.15s;
}

.category-card.selected { border-color: var(--accent); background: var(--accent-soft); }

.category-card.selected .check {
  background: var(--accent);
  border-color: var(--accent);
}

.category-card.selected .check::after {
  content: "";
  position: absolute;
  left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid var(--accent-ink);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.category-text { display: flex; flex-direction: column; gap: 1px; }
.category-text strong { font-size: 1rem; }
.category-text small { color: var(--ink-soft); font-size: 0.83rem; }

/* ---------- modes ---------- */

.mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
}

.mode-label { font-weight: 600; font-size: 0.95rem; }

.segmented {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}

.seg-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 7px 20px;
  cursor: pointer;
}

.seg-btn.active { background: var(--accent); color: var(--accent-ink); }
.seg-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---------- switch ---------- */

.review-head { display: flex; align-items: center; justify-content: space-between; }
.review-head .panel-title { margin: 0; }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  background: var(--line);
  border-radius: 999px;
  transition: background 0.15s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; top: 3px;
  background: var(--surface);
  border-radius: 50%;
  transition: transform 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }

.review-config { margin-top: 16px; }

/* ---------- buttons ---------- */

.btn {
  font: inherit;
  font-weight: 650;
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform 0.05s, opacity 0.15s;
}

.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.55; cursor: wait; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
}

.btn-big { padding: 15px 24px; font-size: 1.05rem; width: 100%; }
.btn-small { padding: 8px 14px; font-size: 0.85rem; }

/* ---------- interview ---------- */

.interview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.progress-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
}

.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.question-zone {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 26px;
  text-align: center;
}

.question-text {
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.45;
  margin: 0;
}

.question-text.veiled { display: none; }

.voice-question-controls { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.question-text:not(.veiled) + .voice-question-controls { margin-top: 18px; }

.speaking-indicator { display: flex; gap: 5px; height: 28px; align-items: center; }

.speaking-indicator span {
  width: 5px;
  height: 8px;
  border-radius: 3px;
  background: var(--ink-soft);
  opacity: 0.45;
}

.speaking-indicator.speaking span {
  background: var(--accent);
  opacity: 1;
  animation: bounce 0.9s ease-in-out infinite;
}

.speaking-indicator.speaking span:nth-child(2) { animation-delay: 0.15s; }
.speaking-indicator.speaking span:nth-child(3) { animation-delay: 0.3s; }
.speaking-indicator.speaking span:nth-child(4) { animation-delay: 0.45s; }

@keyframes bounce {
  0%, 100% { height: 8px; }
  50% { height: 26px; }
}

.voice-question-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.answer-zone { display: flex; flex-direction: column; gap: 12px; }

.answer-zone textarea { min-height: 150px; resize: vertical; line-height: 1.6; }

.voice-answer-controls { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.mic-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: 13px 26px;
  cursor: pointer;
}

.mic-btn.recording {
  background: var(--record);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185, 71, 46, 0.45); }
  50% { box-shadow: 0 0 0 12px rgba(185, 71, 46, 0); }
}

.interim-text {
  min-height: 1.3em;
  margin: 0;
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.92rem;
}

.interview-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.interview-actions .btn-primary { flex: 1; }

/* ---------- summary ---------- */

#summary-list { display: flex; flex-direction: column; gap: 14px; }

.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.summary-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.summary-chip {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 11px;
}

.summary-stats { font-size: 0.82rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.summary-question {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.summary-answer { margin: 0; color: var(--ink-soft); white-space: pre-wrap; }
.summary-answer.skipped { font-style: italic; }

.summary-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* ---------- review output ---------- */

.review-output { margin-top: 16px; font-size: 0.95rem; }
.review-output h3, .review-output h4, .review-output h5 {
  font-family: var(--serif);
  margin: 18px 0 6px;
}
.review-output p { margin: 8px 0; }
.review-output ul, .review-output ol { margin: 8px 0; padding-left: 22px; }
.review-output li { margin: 4px 0; }
.review-output code {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.88em;
}

#review-status.error { color: var(--warn); }

@media (max-width: 480px) {
  .screen { padding: 26px 14px 56px; }
  .question-zone { padding: 24px 18px; }
  .question-text { font-size: 1.25rem; }
  .mode-row { flex-direction: column; align-items: flex-start; gap: 6px; }
}
