/* ------------------------------------------------------------------ *
 * Sofira application form — Typeform/VideoAsk-style.
 * Brand tokens injected at runtime from the role config. Defaults match
 * the "Seleção Dev Python" Typeform: black text/buttons, white button
 * text, #cecece page background — lifted onto a clean white card.
 * ------------------------------------------------------------------ */
:root {
  --brand: #111111;        /* buttons, progress, accents */
  --brand-ink: #ffffff;    /* button text */
  --bg: #cecece;           /* page background */
  --fg: #111111;           /* question + answer text */
  --muted: #5c5c5c;
  --line: #d5d5d5;
  --line-strong: #9a9a9a;
  --card: #ffffff;
  --error: #c0392b;
  --radius: 10px;
  --shadow: 0 10px 40px rgba(0,0,0,.14);
  --maxw: 660px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Keep the header in document flow so it never covers the form or preview notice.
   The existing white wordmark includes transparent canvas around the artwork. */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.brand-header { flex: none; height: 84px; display: flex; align-items: center; padding: 14px 20px 0; overflow: hidden; background: #070606; }
.brand-logo { display: block; flex: none; width: 180px; height: 90px; object-fit: contain; }
.brand-logo[hidden] { display: none; }

/* Progress bar */
.progress { flex: none; height: 4px; background: rgba(0,0,0,.14); }
.progress > span { display: block; height: 100%; width: 0%; background: var(--brand); transition: width .35s ease; }

/* Layout — one centered card per screen */
.app { flex: 1; display: flex; align-items: center; justify-content: center; padding: 36px 20px calc(44px + env(safe-area-inset-bottom)); }
.screen {
  width: 100%; max-width: var(--maxw);
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 40px 38px; animation: fade .4s ease;
}
.screen.wide { max-width: 1160px; padding: 34px; }
@keyframes fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 560px) { .screen, .screen.wide { padding: 28px 22px; border-radius: 14px; } .app { padding-top: 28px; } .brand-header { padding-left: 6px; } }

.q-index { color: var(--muted); font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 12px; }
.heading { font-size: clamp(22px, 4.4vw, 30px); font-weight: 700; line-height: 1.28; margin: 0 0 12px; color: var(--fg); }
.subheading { font-size: clamp(15px, 2.6vw, 18px); color: var(--muted); line-height: 1.6; margin: 0 0 24px; }
.helper-text { font-size: 14.5px; color: var(--muted); line-height: 1.55; margin: -4px 0 22px; }
.required-star { color: var(--error); }

/* Statement (intro-video) screens: split layout on wide viewports */
.statement.split { display: block; }
.statement-media { margin-bottom: 22px; }
/* iframe embeds have NO intrinsic ratio, so pin 16:9 or they collapse to ~150px tall */
.stmt-video { width: 100%; aspect-ratio: 16 / 9; height: auto; max-height: 80vh; border-radius: var(--radius); background: #000; display: block; }
@media (min-width: 820px) {
  .statement.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 44px; align-items: center; }
  .statement-media { margin-bottom: 0; }
}
.statement-body .btn-row { margin-top: 26px; }

/* Welcome media */
.media { margin: 0 0 24px; }
.media .media-box { width: 100%; border: 0; border-radius: var(--radius); background: #000; aspect-ratio: 16 / 9; }

/* Inputs */
.field { width: 100%; }
.field.labeled { margin-bottom: 20px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input[type=text], .field input[type=email], .field input[type=tel],
.field input[type=number], .field input[type=url], .field textarea {
  width: 100%; font-size: 19px; padding: 11px 13px; border: 1.5px solid var(--line);
  background: #fff; color: var(--fg); outline: none; font-family: inherit; border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 100px; }
.field input:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(17,17,17,.08); }
.contact-fields { width: 100%; }

/* Choice options */
.options { display: flex; flex-direction: column; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: 17px; cursor: pointer; transition: border-color .15s, background .15s; user-select: none; }
.option:hover { border-color: var(--line-strong); }
.option.selected { border-color: var(--brand); background: rgba(17,17,17,.05); }
.option .key { border: 1.5px solid var(--line-strong); border-radius: 6px; width: 26px; height: 26px; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); flex: none; }
.option.selected .key { border-color: var(--brand); color: var(--brand); }

/* Buttons */
.btn { appearance: none; border: 0; cursor: pointer; background: var(--brand); color: var(--brand-ink); font-size: 17px; font-weight: 600; font-family: inherit; padding: 12px 30px; border-radius: var(--radius); transition: transform .08s ease, opacity .15s, box-shadow .15s; box-shadow: 0 2px 8px rgba(0,0,0,.16); }
.btn:hover { box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--fg); border: 1.5px solid var(--line-strong); box-shadow: none; }
.btn.ghost:hover { border-color: var(--brand); }
.btn-row { display: flex; align-items: center; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.btn-row.center { justify-content: center; }
.hint { color: var(--muted); font-size: 14px; }
.enter-hint { color: var(--muted); font-size: 12.5px; }

/* Audio recorder */
.recorder[hidden] { display: none; }
select[id^="mode-"] { display: block; width: 100%; margin: 8px 0 20px; padding: 12px; font: inherit; color: var(--fg); background: white; border: 1.5px solid var(--line); border-radius: var(--radius); }
select[id^="mode-"]:focus { outline: 2px solid var(--brand); outline-offset: 2px; }
.recorder { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.rec-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rec-btn { width: 66px; height: 66px; border-radius: 50%; border: 0; cursor: pointer; flex: none; background: var(--brand); color: #fff; display: grid; place-items: center; transition: transform .08s; box-shadow: 0 3px 12px rgba(0,0,0,.2); }
.rec-btn.recording { background: var(--error); animation: pulse 1.3s infinite; }
.rec-btn:active { transform: scale(.95); }
.rec-btn svg { width: 27px; height: 27px; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(192,57,43,.5); } 50% { box-shadow: 0 0 0 14px rgba(192,57,43,0); } }
.rec-timer { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; }
.rec-status { font-size: 14px; color: var(--muted); }
.rec-playback { width: 100%; margin-top: 6px; }
.rec-limit { color: var(--muted); font-size: 13px; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.pill.ok { background: #dcfce7; color: #166534; }
.pill.pending { background: #fef9c3; color: #854d0e; }
.pill.err { background: #fee2e2; color: #991b1b; }

/* Home screen — list of openings */
.home-list { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.opening { display: flex; align-items: center; justify-content: space-between; gap: 16px; text-decoration: none; color: var(--fg); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px 20px; transition: border-color .15s, box-shadow .15s, transform .08s; }
.opening:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(0,0,0,.10); }
.opening:active { transform: translateY(1px); }
.opening-title { font-size: 18px; font-weight: 700; }
.opening-sub { font-size: 14px; color: var(--muted); margin-top: 3px; }
.opening-cta { font-weight: 600; white-space: nowrap; color: var(--brand); }

.error-msg { color: var(--error); font-size: 14px; margin-top: 10px; }

/* LGPD consent checkbox on the final screen */
.consent { display: flex; align-items: flex-start; gap: 10px; text-align: left; font-size: 14px; color: var(--muted); line-height: 1.5; margin: 20px auto 6px; max-width: 560px; cursor: pointer; }
.consent input[type=checkbox] { margin-top: 3px; flex: none; width: 18px; height: 18px; accent-color: var(--brand); }
.consent a { color: var(--brand); }
.ts-widget { display: flex; justify-content: center; margin: 16px 0 4px; }
.center { text-align: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin 1s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.file-input { margin-top: 8px; }
