/* InterviewGrey — Calm, Analytical Design System */

/* Fonts are self-hosted (public/fonts, SIL OFL licences alongside) so visitors' IP addresses are never sent to Google. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/inter-latin-var.woff2') format('woff2'); }
@font-face { font-family: 'DM Serif Display'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/dm-serif-display-400-latin.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/jetbrains-mono-400-latin.woff2') format('woff2'); }

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

:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --text: #1C1C1E;
  --text-dim: #6B6B6B;
  --accent: #2468B0;
  --success-text: #1E7B43;
  --warning-text: #A8560E;
  --danger-text: #B8402F;
  --accent-light: #EBF4FF;
  --success: #2EAF5F;
  --success-light: #E8F7EF;
  --warning: #E07B2A;
  --warning-light: #FFF3E6;
  --danger: #D1453B;
  --danger-light: #FDECEA;
  --border: #E3E2DF;
  --highlight: #FFF3CD;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Layout ─── */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.step-rail {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 48px 32px;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.step-rail-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--text);
  margin-bottom: 48px;
  letter-spacing: -0.3px;
}

.step-list { list-style: none; }

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: default;
  transition: color 0.15s;
}

.step-item.active { color: var(--accent); }
.step-item.done { color: var(--success-text); }

.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.15s;
}

.step-item.active .step-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.step-item.done .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-connector {
  width: 2px;
  height: 20px;
  background: var(--border);
  margin-left: 27px;
}

.step-connector.done { background: var(--success); }

.content-area {
  flex: 1;
  margin-left: 220px;
  padding: 64px 48px;
  max-width: 800px;
}

@media (max-width: 768px) {
  .step-rail { display: none; }
  .content-area { margin-left: 0; padding: 24px 16px; }
}

/* ─── Progress bar (mobile) ─── */
.mobile-progress {
  display: none;
  height: 4px;
  background: var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.mobile-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 16px; }

/* ─── Typography ─── */
h1 { font-family: var(--font-heading); font-size: 36px; font-weight: 400; line-height: 1.2; letter-spacing: -0.5px; }
h2 { font-family: var(--font-heading); font-size: 26px; font-weight: 400; line-height: 1.3; }
h3, h2.card-title { font-family: var(--font-body); font-size: 16px; font-weight: 600; line-height: 1.4; letter-spacing: -0.1px; }
p { color: var(--text-dim); }
.label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); }
.mono { font-family: var(--font-mono); font-size: 13px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #2468b0; }
.btn-primary:disabled { background: var(--border); color: var(--text-dim); cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--text-dim); }
.btn-ghost { background: transparent; color: var(--text-dim); padding: 8px 12px; }
.btn-ghost:hover { color: var(--text); }
.btn-danger-ghost { color: var(--danger-text); }
.btn-danger-ghost:hover { color: var(--danger-text); background: var(--danger-light); }

.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: 10px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ─── Form elements ─── */
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group + .form-group { margin-top: 20px; }

label { font-size: 14px; font-weight: 500; color: var(--text); }

textarea, input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  transition: border-color 0.15s;
}

textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

textarea { min-height: 120px; }

/* ─── Upload Zone ─── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg);
}

.upload-zone:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-zone-icon { font-size: 40px; margin-bottom: 16px; }
.upload-zone p { font-size: 15px; color: var(--text-dim); }
.upload-zone .browse { color: var(--accent); font-weight: 600; cursor: pointer; }

.upload-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--accent-light);
  border: 1px solid #c0d9f7;
  border-radius: 8px;
  margin-top: 16px;
}

.upload-file-card .file-name { flex: 1; font-weight: 500; font-size: 14px; }
.upload-file-card .file-size { font-size: 12px; color: var(--text-dim); }

/* ─── Section header ─── */
.section-header { margin-bottom: 32px; }
.section-header h1, .section-header h2 { margin-bottom: 8px; }
.section-header h1, .view h1.view-title { font-family: var(--font-heading); font-size: 26px; font-weight: 400; line-height: 1.3; letter-spacing: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.section-header p { font-size: 15px; }

/* ─── Context Review ─── */
.context-field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 12px;
}

.context-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.context-field-value {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

.context-field-edited { border-left: 3px solid var(--warning); }

.context-list { list-style: none; margin-top: 8px; }
.context-list li { position: relative; padding-left: 16px; font-size: 15px; }
.context-list li::before { content: '›'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ─── Interview ─── */
.question-card {
  max-width: 640px;
  margin: 0 auto;
}

.question-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 16px;
}

.question-text {
  font-family: var(--font-heading);
  font-size: 28px;
  line-height: 1.3;
  margin-bottom: 12px;
}

.question-prompt {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 32px;
  font-style: italic;
}

.answer-area { margin-top: 24px; }

.answer-submitted {
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
  font-size: 14px;
  color: var(--text-dim);
  white-space: pre-wrap;
  border-left: 3px solid var(--success);
  margin-top: 16px;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}

.char-count.warn { color: var(--warning-text); }
.char-count.over { color: var(--danger-text); }

.question-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.question-progress {
  font-size: 13px;
  color: var(--text-dim);
}

/* ─── Analysis ─── */
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .analysis-grid { grid-template-columns: 1fr; }
}

.analysis-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.analysis-card-header {
  padding: 16px 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.analysis-card-header.strengths { background: var(--success-light); color: var(--success-text); }
.analysis-card-header.risks { background: var(--warning-light); color: var(--warning-text); }
.analysis-card-header.actions { background: var(--accent-light); color: var(--accent); }

.analysis-card-body { padding: 20px; }

.analysis-point {
  font-size: 14px;
  line-height: 1.6;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.analysis-point:last-child { border-bottom: none; }
.analysis-point .evidence-tag {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 6px;
  display: inline-block;
}

.analysis-point .evidence-quote {
  margin: 8px 0 0;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--border);
  font-size: 13px;
  font-style: italic;
  color: var(--text-dim);
}

/* ─── Transitions ─── */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Error / Loading states ─── */
.error-msg {
  background: var(--danger-light);
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--danger-text);
  margin-top: 12px;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loading-overlay {
  text-align: center;
  padding: 64px 32px;
}

.loading-overlay p { margin-top: 16px; font-size: 15px; }

/* ─── Empty / Resume ─── */
.hero {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: 80px 24px;
}

.hero h1 { margin-bottom: 16px; }
.hero p { font-size: 17px; margin-bottom: 40px; }

.session-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  margin-top: 48px;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.session-item:last-child { border-bottom: none; }
.session-item:hover { background: var(--bg); }

.session-info .session-role { font-weight: 600; font-size: 15px; }
.session-info .session-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.session-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 10px;
  border-radius: 20px;
}

.session-status.setup { background: var(--bg); color: var(--text-dim); border: 1px solid var(--border); }
.session-status.interview { background: var(--accent-light); color: var(--accent); }
.session-status.context_review { background: var(--warning-light); color: var(--warning-text); }
.session-status.analysis { background: var(--success-light); color: var(--success-text); }
.session-status.complete { background: var(--success-light); color: var(--success-text); }

/* ─── Utility ─── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.flex { display: flex; }
.flex-end { justify-content: flex-end; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ─── Post-interview sign-up gate ─── */

.gate-complete {
  text-align: center;
  padding: 48px 24px 32px;
  max-width: 520px;
  margin: 0 auto;
}

.gate-check {
  width: 56px;
  height: 56px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.gate-complete h2 { margin-bottom: 8px; }
.gate-complete p  { font-size: 16px; line-height: 1.6; }
.gate-complete strong { color: var(--text); }

.gate-preview-wrap { margin-top: 32px; }

.gate-preview-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.gate-locked-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
}

.gate-locked-pill svg {
  width: 11px;
  height: 11px;
  stroke: var(--text-dim);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gate-preview-footer {
  padding: 10px 20px;
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  border-top: 1px solid var(--border);
  background: var(--bg);
  text-align: center;
}

.gate-unlock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 24px;
  overflow: hidden;
}

.gate-unlock-inner {
  padding: 36px 40px;
  text-align: center;
}

.gate-unlock-card h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.gate-unlock-desc {
  font-size: 15px;
  max-width: 440px;
  margin: 0 auto 28px;
}

.gate-auth-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 300px;
  margin: 0 auto 20px;
}

.gate-auth-btn {
  width: 100%;
  justify-content: center;
  gap: 10px;
}

.gate-auth-fine {
  font-size: 12px;
  color: var(--text-dim);
}

@media (max-width: 768px) {
  .gate-complete { padding: 32px 16px 24px; }
  .gate-unlock-inner { padding: 28px 20px; }
  .gate-preview-titlebar { flex-direction: column; align-items: flex-start; gap: 10px; }
}

.brand-mark { display: block; flex: none; }

/* ─── Interview length, verdict, stronger answers, retry, gate email, rating (2026-10-21) ─── */
.mode-picker { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--surface); display: grid; gap: 12px; }
.mode-picker legend { font-weight: 600; padding: 0 6px; font-size: 15px; }
.mode-option { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.5; cursor: pointer; }
.mode-option input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.mode-option input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.verdict { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 20px; }
.verdict-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.verdict p { margin: 0; font-size: 16px; line-height: 1.6; }

.stronger { margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.stronger summary { cursor: pointer; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--accent); }
.stronger summary:focus-visible, .retry .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.stronger-text { margin: 0; padding: 0 12px; font-size: 14px; line-height: 1.6; }
.stronger-note { margin: 8px 12px 12px; font-size: 12px; color: var(--text-dim); }

.retry { margin-top: 12px; }
.retry-panel { margin-top: 10px; display: grid; gap: 10px; }
.retry-panel textarea { min-height: 110px; }
.retry-lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 4px; }
.retry-result { font-size: 14px; line-height: 1.6; }
.retry-compare { display: grid; gap: 10px; }
.retry-verdict { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--bg); }
.retry-better { background: var(--success-light); color: var(--success-text); }
.retry-weaker { background: var(--warning-light); color: var(--warning-text); }
.retry-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.retry-cols p { margin: 0; }
.retry-compare ul { margin: 0; padding-left: 1.2em; }
@media (max-width: 600px) { .retry-cols { grid-template-columns: 1fr; } }

.gate-email { margin-top: 20px; text-align: left; }
.gate-email-title { font-size: 14px; margin: 0 0 10px; }
.gate-email-row { display: flex; gap: 8px; flex-wrap: wrap; }
.gate-email-input { flex: 1 1 220px; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid #8d8b87; border-radius: 8px; background: #fff; color: var(--text); }
.gate-email-input:focus-visible, .gate-email-consent input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.gate-email-consent { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 13px; line-height: 1.5; }
.gate-email-consent input { margin-top: 3px; flex: none; }
.gate-email-status { min-height: 1.3em; margin: 6px 0 0; font-size: 13px; color: var(--danger-text); }
.gate-email-done { margin: 0; padding: 12px 14px; background: var(--success-light); color: var(--success-text); border-radius: 8px; font-weight: 600; font-size: 14px; }

.rating { text-align: center; }
.rating p { margin: 0 0 8px; }
.rating-btns { display: inline-flex; gap: 8px; }
.rating-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; color: var(--text); }
.rating-btn:hover { border-color: var(--accent); }
.rating-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.rating-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.rating-thanks { min-height: 1.4em; font-size: 14px; color: var(--success-text); margin-top: 8px !important; }
.analysis-card .retry-cols { grid-template-columns: 1fr; }

/* ─── Quick run: things to probe, quick feedback (2026-10-21) ─── */
.probe { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--warning-text); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 16px; }
.probe .card-title { margin: 0 0 8px; }
.probe ol { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; font-size: 15px; line-height: 1.55; }
.probe-note { margin: 12px 0 0; font-size: 13px; color: var(--text-dim); }
.quick-feedback { margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: var(--accent-light); font-size: 14px; line-height: 1.6; }
.quick-feedback p { margin: 0 0 6px; }
.quick-feedback-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.quick-feedback-note { font-size: 12px; color: var(--text-dim); margin: 8px 0 0 !important; }
