/* styles.css — Interview Coach. Warm, calm, approachable. Light theme. */

:root {
  --bg: #f6f5f2;
  --bg-2: #efeee9;
  --card: #ffffff;
  --ink: #232733;
  --ink-soft: #565d6d;
  --ink-faint: #8a91a0;
  --line: #e7e5df;
  --line-soft: #f0eee9;
  --accent: #5b53e8;
  --accent-2: #7c74ff;
  --accent-soft: #eeecff;
  --accent-ink: #4a43cf;
  --good: #1f9d6b;
  --good-soft: #e4f6ee;
  --ok: #c98a12;
  --ok-soft: #fbf0d9;
  --weak: #d75a44;
  --weak-soft: #fbe7e2;
  --shadow: 0 1px 2px rgba(30,32,44,.04), 0 6px 20px rgba(30,32,44,.06);
  --shadow-lg: 0 10px 40px rgba(50,45,120,.14);
  --r: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #efedff 0%, rgba(239,237,255,0) 55%), var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
#app { height: 100%; }

.screen { display: none; height: 100%; flex-direction: column; }
.screen.active { display: flex; }

/* topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; position: sticky; top: 0; z-index: 5;
  background: rgba(246,245,242,.8); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { font-weight: 700; font-size: 16px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.brand-mark { color: var(--accent); }

.container { max-width: 720px; width: 100%; margin: 0 auto; padding: 8px 22px 80px; overflow-y: auto; }

/* hero */
.hero { padding: 34px 0 14px; }
.hero-pill {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: var(--accent-ink); background: var(--accent-soft); padding: 6px 12px; border-radius: 999px;
}
.hero-title { font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; margin: 18px 0 12px; }
.hero-sub { color: var(--ink-soft); font-size: 16px; max-width: 560px; margin: 0; }

/* steps */
.step { margin-top: 34px; }
.step-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.step-no {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700;
}

/* buttons */
button { font-family: inherit; cursor: pointer; border: none; border-radius: 12px; }
.primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff; padding: 11px 20px; font-weight: 600; font-size: 15px;
  box-shadow: 0 4px 14px rgba(91,83,232,.28); transition: transform .08s, box-shadow .2s, opacity .2s;
}
.primary:hover { box-shadow: 0 6px 20px rgba(91,83,232,.38); }
.primary:active { transform: translateY(1px); }
.primary:disabled { background: #cfcde0; box-shadow: none; cursor: not-allowed; color: #fff; }
.primary.big { width: 100%; padding: 16px; font-size: 16px; margin-top: 28px; border-radius: 14px; }
.ghost { background: transparent; color: var(--ink-soft); padding: 8px 12px; font-weight: 500; }
.ghost:hover { color: var(--ink); background: var(--bg-2); }
.danger-ghost { background: transparent; color: var(--weak); padding: 8px 12px; font-weight: 500; }
.danger-ghost:hover { background: var(--weak-soft); }
.small { font-size: 13px; }

/* round cards */
.cards { display: grid; gap: 12px; }
.card {
  text-align: left; background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--r); padding: 18px; color: var(--ink); display: flex; gap: 15px;
  align-items: flex-start; box-shadow: var(--shadow); transition: border-color .15s, transform .1s, box-shadow .2s;
}
.card:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.card-icon {
  flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; background: var(--accent-soft);
}
.card-body { flex: 1; }
.card-title { font-weight: 700; font-size: 16.5px; margin-bottom: 3px; }
.card-blurb { color: var(--ink-soft); font-size: 14px; }
.card-tests { color: var(--ink-faint); font-size: 12px; margin-top: 8px; font-weight: 500; letter-spacing: .01em; }

/* segmented difficulty */
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--bg-2); padding: 6px; border-radius: 14px; }
.seg {
  background: transparent; color: var(--ink-soft); padding: 12px 8px; border-radius: 10px; text-align: center;
  font-weight: 600; transition: .15s;
}
.seg small { display: block; font-weight: 500; font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.seg:hover { color: var(--ink); }
.seg.selected { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.seg.selected small { color: var(--accent-ink); }

/* history */
.history { margin-top: 44px; }
.history-head { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.hist-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; font-size: 14px; box-shadow: var(--shadow); }
.hist-type { flex: 1; font-weight: 600; }
.hist-score { color: var(--accent-ink); font-weight: 700; }
.hist-date { color: var(--ink-faint); font-size: 12.5px; width: 82px; text-align: right; }
.muted { color: var(--ink-faint); }

/* ---- chat ---- */
.chat-top { gap: 12px; }
.phase-track { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; justify-content: center; }
.phase-pill {
  font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  background: var(--bg-2); color: var(--ink-faint); transition: .2s;
}
.phase-pill.on { background: var(--accent); color: #fff; box-shadow: 0 3px 10px rgba(91,83,232,.3); }
.phase-pill.done { background: var(--accent-soft); color: var(--accent-ink); }
.timer { font-family: var(--mono); color: var(--ink-soft); font-size: 14px; min-width: 52px; text-align: right; font-weight: 600; }

.messages { flex: 1; overflow-y: auto; padding: 26px 22px; display: flex; flex-direction: column; gap: 18px; max-width: 780px; width: 100%; margin: 0 auto; }
.msg { display: flex; flex-direction: column; max-width: 80%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.them { align-self: flex-start; }
.who { font-size: 11px; color: var(--ink-faint); margin: 0 4px 5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.bubble { padding: 13px 16px; border-radius: 18px; white-space: pre-wrap; font-size: 15px; box-shadow: var(--shadow); }
.msg.them .bubble { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.me .bubble { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; border-bottom-right-radius: 5px; box-shadow: 0 4px 14px rgba(91,83,232,.25); }

.dots { display: inline-flex; gap: 5px; padding: 2px 0; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25 } 30% { opacity: 1 } }

.composer-wrap { border-top: 1px solid var(--line-soft); background: rgba(246,245,242,.9); backdrop-filter: blur(8px); padding: 14px 22px 16px; }
.composer { display: flex; gap: 10px; align-items: flex-end; max-width: 780px; margin: 0 auto; }
.composer textarea {
  flex: 1; resize: none; background: var(--card); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 15px; font: inherit;
  max-height: 160px; box-shadow: var(--shadow);
}
.composer textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer .send { border-radius: 14px; padding: 13px 22px; }
.finish-link { display: block; margin: 12px auto 0; background: transparent; color: var(--ink-faint); font-weight: 500; font-size: 13.5px; }
.finish-link:hover { color: var(--weak); }

/* voice controls */
.voice-bar { display: flex; align-items: center; gap: 12px; max-width: 780px; margin: 0 auto 10px; }
.voice-toggle {
  background: var(--card); border: 1.5px solid var(--line); color: var(--ink-soft);
  padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; box-shadow: var(--shadow);
}
.voice-toggle:hover:not(:disabled) { border-color: var(--accent-2); color: var(--ink); }
.voice-toggle.on { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 3px 12px rgba(91,83,232,.3); }
.voice-toggle:disabled { opacity: .5; cursor: not-allowed; }
.think-ctl { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-faint); font-weight: 500; }
.think-ctl select {
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); border-radius: 8px; padding: 4px 8px; cursor: pointer;
}
.think-ctl select:focus { outline: none; border-color: var(--accent-2); }
.voice-status { font-size: 13px; font-weight: 500; color: var(--ink-faint); }
.voice-status.speaking { color: var(--accent-ink); }
.voice-status.listening { color: var(--good); }

.mic-btn {
  flex: none; width: 46px; height: 46px; border-radius: 14px; font-size: 20px;
  background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow); transition: .15s;
}
.mic-btn:hover:not(:disabled) { border-color: var(--accent-2); }
.mic-btn:disabled { opacity: .45; cursor: not-allowed; }
.mic-btn.live { background: var(--good-soft); border-color: var(--good); animation: mic-pulse 1.3s infinite; }
@keyframes mic-pulse {
  0% { box-shadow: 0 0 0 0 rgba(31,157,107,.4); }
  70% { box-shadow: 0 0 0 10px rgba(31,157,107,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,157,107,0); }
}

/* ---- feedback ---- */
.fb-head { display: flex; gap: 20px; align-items: center; margin: 24px 0; }
.fb-overall {
  flex: none; width: 108px; height: 108px; border-radius: 24px; display: grid; place-items: center;
  background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow); text-align: center;
}
.fb-overall.good { border-color: var(--good); background: var(--good-soft); }
.fb-overall.ok { border-color: var(--ok); background: var(--ok-soft); }
.fb-overall.weak { border-color: var(--weak); background: var(--weak-soft); }
.fb-num { font-size: 40px; font-weight: 800; line-height: 1; }
.fb-out { color: var(--ink-faint); font-size: 13px; font-weight: 600; margin-top: 2px; }
.fb-verdict { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.fb-summary { color: var(--ink-soft); margin-top: 6px; }

.fb-topfix { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; border-radius: var(--r); padding: 16px 20px; margin-bottom: 20px; box-shadow: var(--shadow-lg); }
.fb-topfix-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .85; margin-bottom: 4px; font-weight: 700; }
.fb-topfix-text { font-weight: 600; font-size: 15.5px; }

.fb-dim { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.fb-dim-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.fb-dim-name { font-weight: 700; font-size: 15.5px; }
.fb-dim-score { font-family: var(--mono); font-weight: 700; font-size: 13px; padding: 4px 11px; border-radius: 9px; background: var(--bg-2); }
.fb-dim-score.good { color: var(--good); background: var(--good-soft); }
.fb-dim-score.ok { color: var(--ok); background: var(--ok-soft); }
.fb-dim-score.weak { color: var(--weak); background: var(--weak-soft); }
.fb-dim-ev, .fb-dim-im { font-size: 14px; margin-top: 8px; color: var(--ink); display: flex; gap: 8px; align-items: baseline; }
.fb-tag { flex: none; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; background: var(--bg-2); color: var(--ink-soft); padding: 3px 8px; border-radius: 7px; font-weight: 700; }
.fb-tag.alt { background: var(--accent-soft); color: var(--accent-ink); }

/* ---- settings modal ---- */
.modal { position: fixed; inset: 0; background: rgba(30,28,50,.45); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 20; }
.modal.open { display: flex; }
.modal-box { background: var(--card); border-radius: 20px; padding: 28px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.modal-box h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.modal-intro { color: var(--ink-soft); font-size: 14px; margin: 0 0 18px; }
.modal-box label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.modal-box input { width: 100%; background: var(--bg); border: 1.5px solid var(--line); color: var(--ink); border-radius: 12px; padding: 12px 14px; font: inherit; }
.modal-box input:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: 12.5px; color: var(--ink-faint); margin: 9px 0 0; }
.mono { font-family: var(--mono); color: var(--accent-ink); font-weight: 600; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-box hr { border: none; border-top: 1px solid var(--line); margin: 20px 0 14px; }

@media (max-width: 560px) {
  .hero-title { font-size: 27px; }
  .msg { max-width: 90%; }
  .fb-head { flex-direction: column; align-items: flex-start; }
  .segmented { grid-template-columns: 1fr 1fr 1fr; }
}
