/* ============================================================
   Voltify Interview — light theme, on-brand (white + blue)
   Palette (Brand Usage Sheet):
     Primary   #0040FF    Black     #141414
     White     #FFFFFF    Secondary #BCC5CC
     Tertiary  #F8F9FA    Gradient  #0040FF -> #AAC8F3
   Type: FK Grotesk (Space Grotesk used as the open web substitute)
   ============================================================ */

:root {
  --white: #ffffff;
  --tertiary: #f8f9fa;
  --black: #141414;
  --primary: #0040ff;
  --primary-hover: #0035d6;
  --secondary: #bcc5cc;
  --grad-1: #0040ff;
  --grad-2: #aac8f3;

  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f8f9fa;
  --line: #e6eaf0;
  --line-strong: #d3dae1;
  --text: #141414;
  --muted: #5c6672;
  --primary-tint: rgba(0, 64, 255, 0.06);
  --primary-tint-2: rgba(0, 64, 255, 0.12);
  --red: #d92d20;

  --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 30, 60, 0.08);
  --shadow-blue: 0 8px 24px rgba(0, 64, 255, 0.16);
  --focus: 0 0 0 3px rgba(0, 64, 255, 0.18);

  --radius: 14px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-label: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must win even over our flex/grid display rules. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Atmospheric background: faint blue blueprint grid + soft wash --- */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(0, 64, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 64, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 45%, transparent 100%);
}
.vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 64, 255, 0.07), transparent 60%),
    radial-gradient(ellipse 70% 50% at 100% 105%, rgba(170, 200, 243, 0.18), transparent 60%);
}

/* --- Top bar --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 5vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo {
  height: 19px;
  width: auto;
  color: var(--black);
  display: block;
}
.brand-sub {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--primary);
  padding-left: 11px;
  border-left: 1px solid var(--line-strong);
}
.topbar-right { display: flex; align-items: center; gap: 18px; }
.status {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 64, 255, 0.14);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.timer {
  font-family: var(--font-label);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  min-width: 64px;
  text-align: center;
}
.timer.warn { color: var(--primary); border-color: var(--primary); }
.timer.over { color: var(--red); border-color: var(--red); }

/* --- Progress rail --- */
.rail { padding: 20px clamp(16px, 5vw, 48px) 0; max-width: 900px; margin: 0 auto; width: 100%; }
.rail-line {
  height: 4px;
  background: #e9edf3;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.rail-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 12.5%;
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2));
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.rail-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
#step-counter { color: var(--primary); }
#step-name { color: var(--muted); text-transform: uppercase; }

/* --- Stage / screens --- */
.stage {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 32px clamp(16px, 5vw, 48px) 40px;
}
.screen { animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.loading { display: grid; place-items: center; min-height: 40vh; }
.loader { font-family: var(--font-label); letter-spacing: 0.3em; color: var(--muted); }
.ell { animation: blink 1.2s steps(4) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* --- Intro --- */
.eyebrow {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--primary);
  margin-bottom: 18px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 8vw, 74px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  white-space: pre-line;
  text-wrap: balance;
  color: var(--black);
}
.hero-tagline {
  font-size: clamp(17px, 2.4vw, 21px);
  color: #37414d;
  max-width: 60ch;
  margin: 0 0 28px;
}
.mission {
  border-left: 3px solid var(--primary);
  padding: 4px 0 4px 20px;
  color: var(--muted);
  max-width: 66ch;
  margin-bottom: 36px;
}

/* Highlighted honesty callout on the intro */
.callout {
  border: 1px solid var(--primary);
  border-left: 4px solid var(--primary);
  background: var(--primary-tint);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 0 0 32px;
  max-width: 66ch;
}
.callout-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary);
  font-size: 18px;
  margin-bottom: 6px;
}
.callout-body { color: #2b333d; font-size: 15px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: var(--shadow-sm);
}
.stat { background: var(--white); padding: 22px 20px; }
.stat .figure {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 4vw, 34px);
  color: var(--primary);
  letter-spacing: -0.01em;
}
.stat .label { font-size: 13px; color: var(--muted); margin-top: 6px; }

.how { margin-bottom: 36px; }
.how-head {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 14px;
}
.how ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.how li {
  position: relative;
  padding-left: 30px;
  color: #2b333d;
}
.how li::before {
  content: "▸";
  position: absolute;
  left: 6px;
  color: var(--primary);
}

.values {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}
.value-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.value-card .v-name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--primary);
  font-size: 15px;
}
.value-card .v-line { font-size: 13px; color: var(--muted); margin-top: 6px; }

.fineprint {
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--muted);
  margin-top: 18px;
  letter-spacing: 0.02em;
}

/* --- Step headers --- */
.step-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 5vw, 40px);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  color: var(--black);
}
.step-desc { color: var(--muted); margin: 0 0 32px; max-width: 62ch; }

/* --- Forms --- */
.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.field .opt { color: #9aa4b0; text-transform: none; letter-spacing: 0; font-weight: 400; }
input[type="text"], input[type="email"], textarea {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 13px 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus);
}
input::placeholder, textarea::placeholder { color: #aab2bd; }
.field.invalid input { border-color: var(--red); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- MCQ options --- */
.mcq-hint {
  display: inline-block;
  font-size: 13px;
  color: var(--primary);
  background: var(--primary-tint);
  border: 1px solid var(--primary-tint-2);
  border-radius: 8px;
  padding: 9px 13px;
  margin: 0 0 28px;
}
.mcq-hint strong { font-weight: 600; }
.question { margin-bottom: 30px; }
.q-prompt { font-size: 17px; font-weight: 500; margin-bottom: 14px; color: var(--black); }
.q-num { font-family: var(--font-label); color: var(--primary); margin-right: 8px; font-size: 14px; font-weight: 600; }
.options { display: grid; gap: 10px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--white);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.05s;
}
.option:hover { border-color: var(--primary); background: var(--panel-2); }
.option.selected {
  border-color: var(--primary);
  background: var(--primary-tint);
  box-shadow: var(--focus);
}
.option .key {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.option.selected .key { color: var(--white); background: var(--primary); border-color: var(--primary); }
.option .otext { flex: 1; }

/* The injected "I don't know" choice — visually set apart, never penalized */
.option-idk { border-style: dashed; }
.option-idk .otext { color: var(--muted); font-style: italic; }
.option-idk.selected .otext { color: var(--primary); font-style: normal; }

/* --- Stack check --- */
.stack-group { margin-bottom: 26px; }
.stack-group h3 {
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 12px;
}
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-size: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 15px;
  cursor: pointer;
  background: var(--white);
  color: var(--text);
  transition: all 0.15s;
  user-select: none;
}
.chip:hover { border-color: var(--primary); }
.chip.on {
  border-color: var(--primary);
  color: var(--white);
  background: var(--primary);
  font-weight: 600;
}

/* --- Chat / scenarios --- */
.scenario-intro {
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  background: var(--panel-2);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
  white-space: pre-line;
  color: #2b333d;
}
.chat {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}
.bubble {
  max-width: 82%;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.55;
  animation: rise 0.3s ease both;
  white-space: pre-wrap;
}
.bubble.interviewer {
  align-self: flex-start;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.bubble.candidate {
  align-self: flex-end;
  background: var(--primary-tint);
  border: 1px solid var(--primary);
  border-bottom-right-radius: 4px;
}
.bubble .who {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.bubble.candidate .who { color: var(--primary); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--secondary);
  animation: bounce 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-5px); opacity: 1; } }

.composer { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { min-height: 54px; }
.chat-meta {
  font-family: var(--font-label);
  font-size: 11px;
  color: var(--muted);
  margin: 10px 2px 0;
  letter-spacing: 0.03em;
}
.chat-done {
  color: var(--primary);
  border: 1px dashed var(--primary);
  background: var(--primary-tint);
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 13px;
  margin-top: 6px;
}

/* --- Buttons --- */
.btn {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 10px;
  padding: 12px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 10px 28px rgba(0, 64, 255, 0.28); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; background: var(--secondary); color: #fff; }
.btn-ghost {
  background: var(--white);
  border-color: var(--line-strong);
  color: var(--muted);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-lg { padding: 15px 30px; font-size: 15px; }
.btn-send { padding: 13px 20px; }

/* --- Nav bar --- */
.navbar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px clamp(16px, 5vw, 48px);
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}
.nav-spacer { flex: 1; }

/* --- Thank you --- */
.thankyou { text-align: center; padding-top: 6vh; }
.check {
  width: 70px; height: 70px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 24px;
  font-size: 34px;
  color: var(--white);
  background: var(--primary);
  box-shadow: var(--shadow-blue);
}
.thankyou .hero-tagline { margin-inline: auto; }

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 50;
  box-shadow: var(--shadow-md);
  animation: rise 0.3s ease both;
  max-width: 90vw;
}

@media (max-width: 620px) {
  .stats { grid-template-columns: 1fr; }
  .bubble { max-width: 92%; }
}
