/* ===== Design tokens =====
   One family (Figtree), cool daylight paper, the company's own brand color carries identity.
   The memorable element: the round camera "porthole" wrapped by a live timer ring. */
@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap");
:root {
  --brand: #1f3a5f;        /* overridden per company */
  --accent: #c9a227;       /* overridden per company */
  --paper: #f5f7fa;
  --card: #ffffff;
  --ink: #18202c;
  --ink-2: #4a5566;
  --muted: #6b7686;
  --line: #e3e8ee;
  --mist: #eef2f6;
  --ok: #1d9a68;
  --rec: #e0473e;
  --danger: #c0392b;
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(24,32,44,.05), 0 8px 24px -12px rgba(24,32,44,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.55 "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ===== Buttons & fields ===== */
button, .btn { appearance: none; border: 0; border-radius: 999px; padding: 14px 22px; font: 600 16px/1.2 inherit; font-family: inherit; cursor: pointer; background: var(--brand); color: #fff; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s ease, filter .15s ease; }
button:hover, .btn:hover { filter: brightness(1.06); }
button:active, .btn:active { transform: scale(.98); }
button.secondary, .btn.secondary { background: var(--mist); color: var(--ink); }
button.ghost { background: transparent; color: var(--ink-2); padding: 10px 12px; }
button.danger { background: var(--danger); }
button.accent { background: var(--accent); color: #1b1b1b; }
button.rec { background: var(--rec); }
button.small { padding: 8px 14px; font-size: 14px; }
button:disabled { opacity: .45; cursor: default; transform: none; }
.full { width: 100%; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=search], textarea, select { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); font: inherit; font-size: 16px; background: #fff; color: var(--ink); transition: border-color .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); }
textarea { min-height: 84px; resize: vertical; }
input[type=color] { width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 4px; background: #fff; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.error { background: #fdeceb; color: #8a1f14; border-radius: var(--r-sm); padding: 12px 14px; margin: 12px 0; }
.notice { background: #fff6dc; color: #6b5400; border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 14px; font-size: 15px; }
.linkbox { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--mist); padding: 9px 11px; border-radius: 8px; word-break: break-all; }

/* =====================================================================
   APPLICANT EXPERIENCE
   ===================================================================== */
.ap-top { display: flex; align-items: center; gap: 12px; padding: 16px 20px; max-width: 640px; margin: 0 auto; }
.ap-top .logo { height: 40px; width: auto; max-width: 140px; object-fit: contain; }
.ap-top .mark { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.ap-top .co { font-weight: 700; line-height: 1.2; }
.ap-top .step { font-size: 14px; color: var(--muted); }
.ap-main { max-width: 640px; margin: 0 auto; padding: 0 16px 60px; }
.panel { background: var(--card); border-radius: var(--r-lg); padding: 26px 22px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 14px; }
.screen { animation: enter .35s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
h1.big { font-size: clamp(28px, 6.4vw, 38px); line-height: 1.12; letter-spacing: -.02em; font-weight: 800; margin: 0 0 10px; }
h2 { font-size: 22px; line-height: 1.25; letter-spacing: -.01em; margin: 0 0 8px; font-weight: 800; }
.lede { color: var(--ink-2); font-size: 18px; margin: 0 0 18px; }

/* welcome: the real sequence of the interview */
.how { list-style: none; padding: 0; margin: 18px 0 4px; display: grid; gap: 10px; counter-reset: how; }
.how li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r-md); background: var(--mist); counter-increment: how; }
.how li::before { content: counter(how); width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.how b { display: block; }
.how span { color: var(--muted); font-size: 15px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }
.facts span { background: color-mix(in srgb, var(--brand) 9%, white); color: var(--brand); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.welcome-video { margin: 0 0 16px; border-radius: var(--r-md); overflow: hidden; background: #000; }
.welcome-video video { display: block; width: 100%; max-height: 360px; }
.small-print { font-size: 14px; color: var(--muted); text-align: center; margin: 14px 0 0; }

/* walkthrough */
.guide-stage { position: relative; aspect-ratio: 16/11; border-radius: var(--r-md); background: color-mix(in srgb, var(--brand) 7%, white); overflow: hidden; display: grid; place-items: center; }
.guide-stage svg { width: 78%; height: auto; }
.guide-stage .art { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .45s ease; }
.guide-stage .art.on { opacity: 1; }
.guide-caption { min-height: 84px; margin: 16px 0 8px; }
.guide-caption h2 { margin-bottom: 4px; }
.guide-caption p { margin: 0; color: var(--ink-2); }
.dots { display: flex; gap: 6px; margin: 8px 0 18px; }
.dots i { height: 6px; flex: 1; border-radius: 3px; background: var(--line); overflow: hidden; position: relative; }
.dots i.done { background: var(--brand); }
.dots i.now::after { content: ""; position: absolute; inset: 0; background: var(--brand); transform-origin: left; animation: fill var(--dur, 6s) linear forwards; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.pulse-dot { animation: pd 1.2s ease-in-out infinite; transform-origin: center; }
@keyframes pd { 50% { opacity: .35; } }
.spin-ring { animation: sr 6s linear infinite; transform-origin: center; }
@keyframes sr { to { stroke-dashoffset: 0; } }

/* the porthole: round camera view wrapped by a timer ring */
.porthole { position: relative; width: min(78vw, 340px); aspect-ratio: 1; margin: 6px auto 14px; }
.porthole video { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); border-radius: 50%; object-fit: cover; background: #1b2230; }
.porthole video.mirror { transform: scaleX(-1); }
.porthole svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.porthole .track { fill: none; stroke: var(--line); stroke-width: 8; }
.porthole .bar { fill: none; stroke: var(--brand); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .2s; }
.porthole.recording .bar { stroke: var(--rec); }
.porthole.recording::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; box-shadow: 0 0 0 0 rgba(224,71,62,.45); animation: glow 1.6s ease-out infinite; pointer-events: none; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(224,71,62,.42); } 100% { box-shadow: 0 0 0 16px rgba(224,71,62,0); } }
.porthole .badge { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.porthole.recording .badge { background: var(--rec); }
.porthole.recording .badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pd 1s infinite; }
.porthole .think { position: absolute; inset: 14px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 8%, white); display: grid; place-items: center; text-align: center; }
.porthole .think b { display: block; font-size: 56px; line-height: 1; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.porthole .think span { color: var(--muted); font-size: 15px; }
.qcount { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.qbar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 18px; }
.qbar > div { height: 100%; background: var(--brand); width: 0; transition: width .4s ease; }
.question-text { font-size: clamp(21px, 5vw, 25px); line-height: 1.3; font-weight: 700; letter-spacing: -.01em; margin: 0 0 6px; }
.playback { width: 100%; border-radius: var(--r-md); background: #000; aspect-ratio: 4/3; display: block; }
.upbar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin-top: 10px; }
.upbar > div { height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.practice-tag { display: inline-block; background: #fff6dc; color: #6b5400; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; margin-bottom: 10px; }

/* setup checklist */
.checks { list-style: none; padding: 0; margin: 6px 0 16px; display: grid; gap: 8px; }
.checks li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--mist); font-weight: 600; }
.checks li .ic { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line); flex: none; display: grid; place-items: center; transition: all .25s; }
.checks li.ok .ic { background: var(--ok); border-color: var(--ok); }
.checks li.ok .ic::after { content: ""; width: 10px; height: 6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg) translate(1px,-1px); }
.checks li.warn .ic { border-color: var(--accent); }
.checks li small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.meter { height: 6px; border-radius: 3px; background: #fff; overflow: hidden; margin-top: 6px; }
.meter > div { height: 100%; width: 0; background: var(--ok); transition: width .08s; }

/* done */
.done-mark { width: 92px; height: 92px; margin: 6px auto 16px; display: block; }
.done-mark circle { fill: none; stroke: var(--ok); stroke-width: 5; stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw .7s ease forwards; }
.done-mark path { fill: none; stroke: var(--ok); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .4s .55s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.center { text-align: center; }
.next-steps { text-align: left; background: var(--mist); border-radius: var(--r-md); padding: 14px 16px; margin-top: 16px; }

/* camera help */
.help-steps ol { padding-left: 22px; margin: 8px 0; }
.help-steps li { margin-bottom: 6px; }
#qr svg { width: 180px; height: 180px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}

/* =====================================================================
   DASHBOARD
   ===================================================================== */
body.dash { font-size: 16px; }
.dash-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.side .brandline { font-weight: 800; font-size: 15px; padding: 4px 8px 12px; line-height: 1.25; }
.side .brandline small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }
.side select.switcher { margin: 0 0 12px; font-size: 14px; padding: 10px; }
.side nav { display: grid; gap: 2px; }
.side nav button { justify-content: flex-start; background: transparent; color: var(--ink-2); border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 15px; }
.side nav button.active { background: color-mix(in srgb, var(--brand) 10%, white); color: var(--brand); }
.side .grow { flex: 1; }
.dash-main { padding: 24px 28px 60px; max-width: 1120px; width: 100%; }
.dash-main h1 { font-size: 26px; letter-spacing: -.01em; margin: 0 0 4px; font-weight: 800; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; margin-bottom: 16px; }
.summary { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); margin: 4px 0 18px; font-size: 15px; }
.summary b { color: var(--ink); font-size: 17px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.toolbar select { width: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tr.click { cursor: pointer; }
tr.click:hover { background: #fafbfd; }
.who { display: flex; align-items: center; gap: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--mist); white-space: nowrap; }
.pill.new { background: #e8f0ff; color: #1d4ed8; }
.pill.next_stage { background: #e3f6ec; color: #136c43; }
.pill.hold { background: #fff4d6; color: #7a5a00; }
.pill.not_a_fit { background: #f6e3e1; color: #8a1f14; }
.pill.in_progress { background: #f0f1f3; color: #555; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--muted); font-size: 14px; }
.stars button { background: none; color: #c8ccd3; font-size: 28px; padding: 0 2px; border-radius: 6px; }
.stars button.on { color: var(--accent); }
.answer { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.answer video { width: 100%; max-height: 440px; background: #000; border-radius: var(--r-sm); }
.transcript { background: var(--mist); border-radius: var(--r-sm); padding: 12px 14px; font-size: 15px; white-space: pre-wrap; margin-top: 10px; }
.qedit { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; margin-bottom: 10px; background: #fbfcfd; }
.qedit .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qedit .nums label { font-size: 12px; margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.stat { font-size: 14px; color: var(--muted); }
.stat b { color: var(--ink); font-size: 18px; }
.media-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.media-row video { width: 220px; border-radius: var(--r-sm); background: #000; }
.media-row img { height: 54px; border-radius: 8px; background: var(--mist); padding: 4px; }
.mobile-tabs { display: none; }
.dash-login { max-width: 420px; margin: 60px auto; }
@media (max-width: 860px) {
  .dash-shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; }
  .side nav { grid-auto-flow: column; overflow-x: auto; }
  .side .grow { display: none; }
  .dash-main { padding: 18px 14px 50px; }
  .hide-sm { display: none; }
  .grid2 { grid-template-columns: 1fr; }
}
