/* NextStep look ("Aurora"): night-blue glass with a cyan > violet > pink glow.
   Change colours and fonts in :root. Fonts are bundled in /static/fonts (works offline). */
@font-face { font-family: "Bricolage"; font-weight: 800; font-display: swap; src: url("/static/fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage"; font-weight: 700; font-display: swap; src: url("/static/fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 400; font-display: swap; src: url("/static/fonts/sora-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 600; font-display: swap; src: url("/static/fonts/sora-latin-600-normal.woff2") format("woff2"); }

:root {
  --display: "Bricolage", "Segoe UI", system-ui, sans-serif;
  --body: "Sora", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ink: #e9f1f8; --muted: #9fb4c7; --label: #a7b6ff;
  --a1: #35d0ff; --a2: #8b7bff; --a3: #ff7ad9;
  --grad: linear-gradient(90deg, var(--a1), var(--a2), var(--a3));
  --grad2: linear-gradient(90deg, var(--a1), var(--a2));
  --good: #3ecf8e; --bad: #ff7b66; --warm: #ffa14a;
  --panel: rgba(14, 30, 54, .78); --soft: rgba(255,255,255,.06); --line: rgba(255,255,255,.12); --edge: rgba(139,123,255,.38);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { color-scheme: dark; }
body {
  margin: 0; color: var(--ink); font-family: var(--body); font-size: .95rem;
  background:
    radial-gradient(900px 600px at 12% 8%, rgba(139,123,255,.14), transparent 60%),
    radial-gradient(900px 700px at 88% 62%, rgba(53,208,255,.07), transparent 60%),
    linear-gradient(135deg, #050a13 0%, #08121f 60%, #0a1727 100%) fixed;
}
#globe { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; opacity: .62; }
.veil { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(6,14,26,.9) 0%, rgba(6,14,26,.7) 36%, rgba(6,14,26,.2) 60%, rgba(6,14,26,0) 80%); }
.topbar, .page { position: relative; z-index: 1; }
.g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- centred wordmark ---------- */
.topbar { display: flex; justify-content: center; padding: 1.1rem 1rem .4rem; }
.brand { display: inline-flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--ink); }
.brand-icon { width: clamp(2.4rem, 5vw, 3.4rem); height: clamp(2.4rem, 5vw, 3.4rem); filter: drop-shadow(0 6px 18px rgba(139,123,255,.45)); }
.word { font-family: var(--display); font-weight: 800; letter-spacing: -.035em; line-height: 1; font-size: clamp(2.5rem, 6vw, 3.9rem); }
body[data-page="results"] .word { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
body[data-page="results"] .brand-icon { width: 1.9rem; height: 1.9rem; }
.page { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem) 3rem; }

/* ---------- welcome ---------- */
.hero { padding: clamp(.2rem, 1.5vh, 1rem) 0 1.5rem; max-width: 560px; }
.hero-title { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.04; letter-spacing: -.025em; margin: 0 0 .7rem; }
.hero-title em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: clamp(.98rem, 1.5vw, 1.1rem); color: var(--muted); margin-bottom: 1.1rem; max-width: 34rem; }
.start-card { padding: 1.25rem 1.4rem; max-width: 500px; }

/* ---------- cards: glass with a gradient edge ---------- */
.glass, .glass-card {
  border: 1px solid transparent; border-radius: 24px;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, linear-gradient(135deg, rgba(53,208,255,.55), rgba(139,123,255,.45), rgba(255,122,217,.45)) border-box;
  box-shadow: 0 0 36px rgba(139,123,255,.16), 0 18px 50px rgba(0,0,0,.38);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.glass-card { margin-bottom: 1.25rem; overflow: hidden; }
.glass-card .card-header { background: transparent; border: 0; padding: 1.05rem 1.3rem .35rem; font-family: var(--display); font-weight: 700; font-size: 1.08rem;
  display: flex; justify-content: space-between; align-items: center; }
.glass-card .card-body { padding: .5rem 1.3rem 1.3rem; }
.glass-card .list-group-item { background: transparent; border-color: var(--line); color: var(--ink); padding: .7rem 1.3rem; }
.glass-card .table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: var(--line); --bs-table-active-bg: rgba(139,123,255,.15); }
.glass-card .table > :not(caption) > * > * { padding: .6rem 1.1rem; }
.glass-alert { border-radius: 16px; border: 1px solid rgba(255,123,102,.4); background: rgba(255,123,102,.14); color: #ffbcb0; }

/* ---------- forms ---------- */
.form-label, .eyebrow { font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .13em; color: var(--label); }
.form-select, .form-control { border-radius: 16px; border: 1px solid rgba(255,255,255,.16); background-color: rgba(255,255,255,.06); color: var(--ink); padding: .75rem 1rem; }
.form-select:focus, .form-control:focus { background-color: rgba(255,255,255,.09); border-color: var(--a2); box-shadow: 0 0 0 .22rem rgba(139,123,255,.28); color: var(--ink); }
.form-control::file-selector-button { background: rgba(139,123,255,.25); color: var(--ink); border: 0; border-radius: 10px; padding: .35rem .8rem; margin-right: .8rem; }
.form-select option { color: #111; }
.form-text { color: var(--muted); }
.btn-go, .btn-primary { background: var(--grad2); border: 0; color: #06101e; border-radius: 16px; padding: .85rem 1.2rem; font-weight: 600;
  box-shadow: 0 8px 28px rgba(80,160,255,.38); transition: transform .15s, box-shadow .15s, filter .15s; }
.btn-go:hover, .btn-primary:hover { background: var(--grad2); color: #06101e; filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 12px 34px rgba(80,160,255,.5); }
.btn-go:disabled { opacity: .7; }
.btn-ghost { background: var(--soft); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; }
.btn-ghost:hover { background: rgba(255,255,255,.13); color: #fff; }
.btn-outline-secondary { border-radius: 12px; }

/* ---------- candidate block ---------- */
.who { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; margin: 0 0 1.2rem; border-radius: 16px;
  background: linear-gradient(135deg, rgba(53,208,255,.13), rgba(139,123,255,.14)); border: 1px solid rgba(139,123,255,.42); }
.who .av, .who-chip .av { flex: 0 0 auto; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800;
  background: var(--grad2); color: #06101e; }
.who-text { display: flex; flex-direction: column; min-width: 0; }
.who b { font-family: var(--display); font-size: 1.05rem; line-height: 1.2; }
.who span { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who.busy .av { animation: pulse 1s ease-in-out infinite; }
.who.warn { background: rgba(255,161,74,.12); border-color: rgba(255,161,74,.5); }
.who.warn .av { background: var(--warm); }
@keyframes pulse { 50% { opacity: .45; } }
.who-chip { display: inline-flex; align-items: center; gap: .5rem; margin-right: .6rem; padding: .2rem .7rem .2rem .25rem; border-radius: 999px;
  background: rgba(139,123,255,.18); border: 1px solid rgba(139,123,255,.4); color: var(--ink); }
.who-chip .av { width: 1.7rem; height: 1.7rem; font-size: .72rem; }
.who-chip b { font-family: var(--display); font-size: .95rem; }

/* ---------- results header and tabs ---------- */
.run-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: .8rem 0 1rem; }
.run-goal { font-family: var(--display); font-size: clamp(1.7rem, 3.8vw, 2.5rem); font-weight: 800; letter-spacing: -.02em; margin: 0; }
.run-cv { color: var(--muted); font-size: .88rem; margin-top: .35rem; }
.run-actions { display: flex; align-items: center; gap: .75rem; }
#run-status { font-size: .82rem; padding: .45rem .85rem; border-radius: 999px; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1.25rem; padding: .35rem; border-radius: 999px; width: fit-content; max-width: 100%;
  background: var(--panel); border: 1px solid var(--edge); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tab { border: 0; background: transparent; color: var(--muted); padding: .5rem 1rem; border-radius: 999px; font-weight: 600; font-size: .86rem; font-family: var(--body); transition: color .15s, background .15s; }
.tab:hover { color: var(--ink); }
.tab.active { color: #06101e; background: var(--grad2); box-shadow: 0 4px 16px rgba(80,160,255,.4); }
.pane { display: none; }
.pane.active { display: block; }

/* ---------- agent workflow ---------- */
.live { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: .2rem .6rem; border-radius: 999px; background: var(--soft); font-family: var(--body); }
.live.on { color: #1c1004; background: var(--warm); animation: blink 1.2s ease-in-out infinite; }
.live.done { color: #04170f; background: var(--good); }
@keyframes blink { 50% { opacity: .55; } }
.ai-badge { margin: .15rem 1.3rem .25rem; padding: .3rem .75rem; border-radius: 999px; font-size: .76rem; font-weight: 600; width: fit-content; }
.ai-badge.ok { background: rgba(62,207,142,.16); color: #8ff0c4; }
.ai-badge.warn { background: rgba(255,161,74,.18); color: #ffc58a; }
.agent-list { list-style: none; margin: 0; padding: .25rem .8rem .9rem; }
.agent { padding: .75rem .65rem; border-radius: 16px; transition: background .3s; }
.agent.running { background: rgba(139,123,255,.12); box-shadow: inset 0 0 0 1px rgba(139,123,255,.45); }
.agent-top { display: flex; align-items: center; gap: .75rem; }
.agent-num { flex: 0 0 auto; width: 1.95rem; height: 1.95rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--soft); color: var(--muted); }
.agent.running .agent-num { background: var(--grad2); color: #06101e; box-shadow: 0 0 0 5px rgba(139,123,255,.25); }
.agent.complete .agent-num { background: var(--good); color: #04170f; }
.agent.failed .agent-num { background: var(--bad); color: #2a0a04; }
.agent-name { font-family: var(--display); font-weight: 700; line-height: 1.2; }
.agent-note { color: var(--muted); font-size: .8rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.agent-state { margin-left: auto; font-size: .74rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.agent.running .agent-state { color: var(--a1); } .agent.complete .agent-state { color: var(--good); } .agent.failed .agent-state { color: var(--bad); }
.track { height: 5px; border-radius: 99px; background: var(--soft); margin: .6rem 0 0 2.7rem; overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 99px; background: var(--grad); transition: width .6s ease; }
.agent.complete .fill { width: 100%; }
.agent.failed .fill { width: 100%; background: var(--bad); }
.agent.running .fill { width: 45%; background: linear-gradient(90deg, rgba(53,208,255,.15), var(--a2), var(--a3), rgba(255,122,217,.15)); background-size: 200% 100%; animation: flow 1.3s linear infinite; }
@keyframes flow { to { background-position: -200% 0; } }
.agent.future { opacity: .55; }

/* ---------- match score ---------- */
.score-row { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1rem; }
.ring { --p: 0; width: 6.6rem; height: 6.6rem; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-family: var(--display); font-size: 1.7rem; font-weight: 800; position: relative;
  background: conic-gradient(var(--a1) 0, var(--a2) calc(var(--p) * .55%), var(--a3) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); box-shadow: 0 0 28px rgba(139,123,255,.3); }
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #0d2038; }
.ring span { position: relative; }
.score-level { font-family: var(--display); font-size: 1.3rem; font-weight: 700; }
.mini-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.mini { background: var(--soft); border: 1px solid var(--line); border-radius: 16px; padding: .75rem .5rem; text-align: center; font-size: .78rem; color: var(--muted); }
.mini-n { font-family: var(--display); font-size: 1.55rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.mini.good .mini-n { color: var(--good); } .mini.bad .mini-n { color: var(--bad); }

/* ---------- chips, logs, misc ---------- */
.skill-chip { display: inline-block; margin: 0 .35rem .35rem 0; padding: .25rem .75rem; border-radius: 999px; background: rgba(139,123,255,.18); border: 1px solid rgba(139,123,255,.3); color: #cfd6ff; font-size: .84rem; }
.skill-chip.matched { background: rgba(62,207,142,.15); border-color: rgba(62,207,142,.3); color: #8ff0c4; }
.skill-chip.missing { background: rgba(255,123,102,.15); border-color: rgba(255,123,102,.3); color: #ffb6a8; }
.log-panel { max-height: 460px; overflow-y: auto; font-size: .86rem; }
.log-entry { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.log-entry:last-child { border-bottom: 0; }
.log-agent { font-weight: 700; display: block; font-size: .74rem; color: var(--a1); }
.log-entry.warning .log-agent { color: #f0b84a; } .log-entry.error .log-agent { color: var(--bad); }
.source-note { color: var(--muted); font-size: .82rem; padding: .25rem .5rem; }
.progress { background: var(--soft); border-radius: 99px; }
.badge { font-weight: 700; }
.text-muted { color: var(--muted) !important; }
h1, h2, h3, h4, h5 { font-family: var(--display); }

@media (max-width: 760px) {
  .veil { background: linear-gradient(180deg, rgba(6,14,26,0) 0%, rgba(6,14,26,.25) 25%, rgba(6,14,26,.88) 48%, rgba(6,14,26,.92) 100%); }
  .hero { padding-top: 30vh; }
  .tabs { border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) { .agent.running .fill, .live.on, .who.busy .av { animation: none; } }


/* ---------- v2: drag and drop, start button ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .15rem; text-align: center; cursor: pointer; padding: 1.1rem 1rem;
  border: 2px dashed rgba(139,123,255,.6); border-radius: 18px; background: rgba(139,123,255,.07); color: var(--a1); transition: border-color .15s, background .15s, transform .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--a1); background: rgba(53,208,255,.1); }
.dropzone.over { transform: scale(1.015); }
.dropzone.has-file { border-style: solid; border-color: rgba(62,207,142,.6); background: rgba(62,207,142,.07); }
.dz-title { color: var(--ink); font-weight: 600; font-size: .95rem; word-break: break-all; }
.dz-sub { color: var(--muted); font-size: .78rem; } .dz-sub u { color: var(--a1); }
.btn-start { font-size: 1.1rem; padding: 1rem 1.2rem; box-shadow: 0 0 0 4px rgba(53,208,255,.18), 0 10px 34px rgba(80,160,255,.5); }
.btn-start:hover { box-shadow: 0 0 0 5px rgba(53,208,255,.26), 0 14px 40px rgba(80,160,255,.6); }
.start-note { text-align: center; color: var(--muted); font-size: .76rem; margin-top: .6rem; }
.who { margin-bottom: .9rem; }
.btn-sm.btn-go { padding: .5rem .95rem; border-radius: 12px; font-size: .84rem; }
.where { color: var(--muted); }

/* ---------- v2: numbered step bar ---------- */
.steps { display: flex; flex-wrap: wrap; margin-bottom: 1.2rem; border-radius: 18px; overflow: hidden; background: var(--soft); border: 1px solid var(--line); }
.steps .tab { flex: 1 1 0; min-width: 8.5rem; display: flex; flex-direction: column; align-items: flex-start; gap: .05rem; text-align: left; border-radius: 0;
  padding: .6rem .9rem; border-right: 1px solid var(--line); font-size: .84rem; box-shadow: none; }
.steps .tab:last-child { border-right: 0; }
.steps .tab i { font-style: normal; font-size: .7rem; font-weight: 700; color: var(--label); }
.steps .tab.active { color: var(--ink); background: linear-gradient(90deg, rgba(53,208,255,.24), rgba(139,123,255,.24)); box-shadow: none; }
.steps .tab.active i { color: var(--a1); }
.steps .tab.help, .steps .tab.help i { color: var(--a1); }
.pager { display: flex; justify-content: space-between; margin-top: 1.2rem; }
.pager-btn { background: transparent; border: 0; color: var(--muted); font-weight: 600; font-size: .86rem; padding: .4rem .2rem; font-family: var(--body); }
.pager-btn.next { color: var(--a1); }
.pager-btn:hover { color: #fff; }

/* ---------- v2: overview ---------- */
.ov-grid { display: grid; gap: 1.1rem; }
.ov-grid.two { grid-template-columns: 1.1fr 1fr; } .ov-grid.three { grid-template-columns: repeat(3, 1fr); }
.ov-grid > .glass-card { margin-bottom: 0; } .ov-grid { margin-bottom: 1.1rem; }
.score-card { display: flex; align-items: center; gap: 1.6rem; padding: 1.3rem; flex-wrap: wrap; }
.ring.big { width: 12.5rem; height: 12.5rem; font-size: 4.6rem; line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring.big::before { inset: 14px; background: #0b1829; }
.ring.big span, .ring.big small { position: relative; }
.ring.big span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ring.big small { font-family: var(--body); font-size: .76rem; font-weight: 400; color: var(--muted); margin-top: .1rem; }
.score-level { font-family: var(--display); font-size: 1.9rem; font-weight: 800; margin: .1rem 0 .2rem; }
.score-card .mini-cards { margin-top: .9rem; }
.bar-row { margin-bottom: .8rem; } .bar-row > div:first-child { display: flex; justify-content: space-between; font-size: .88rem; }
.bar-row b { color: var(--muted); font-weight: 600; }
.bar { height: 8px; border-radius: 99px; background: var(--soft); margin-top: .3rem; overflow: hidden; }
.bar > div { height: 100%; width: 0; border-radius: 99px; background: var(--grad2); transition: width .8s ease; }
.plain { margin: 0; padding-left: 1.1rem; line-height: 1.9; font-size: .92rem; } ul.plain { list-style: none; padding-left: 0; }
.cert-name { font-family: var(--display); font-size: 1.5rem; font-weight: 800; margin-bottom: .2rem; }
.have-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding-top: 1rem; }
.have-strip #ov-have { display: contents; } .have-strip .skill-chip { margin: 0; }
#agents-card.compact .agent-list { display: flex; flex-wrap: wrap; gap: .4rem; padding: .3rem 1.1rem 1rem; }
#agents-card.compact .agent { padding: .3rem .8rem .3rem .4rem; background: rgba(62,207,142,.1); border-radius: 99px; }
#agents-card.compact .agent-note, #agents-card.compact .track, #agents-card.compact .agent-state { display: none; }
#agents-card.compact .agent-num { width: 1.4rem; height: 1.4rem; font-size: .7rem; }
#agents-card.compact .agent-name { font-size: .84rem; }

/* ---------- v2: how it works ---------- */
.how-title { font-family: var(--display); font-weight: 800; font-size: clamp(1.7rem, 3.4vw, 2.3rem); letter-spacing: -.02em; margin: .2rem 0 .4rem; }
.how-lead { color: var(--muted); max-width: 46rem; margin-bottom: 1.2rem; }
.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; }
.how-card { border: 1px solid var(--edge); border-radius: 18px; background: var(--panel); padding: 1rem; }
.how-card i { display: block; font-style: normal; font-family: var(--display); font-weight: 800; font-size: 1.6rem; }
.how-card.c1 i { color: var(--a1); } .how-card.c2 i { color: var(--a2); } .how-card.c3 i { color: var(--a3); }
.how-card p { margin: .3rem 0 0; font-size: .84rem; color: var(--muted); line-height: 1.45; }
.how-card.aws { border-style: dashed; border-color: rgba(62,207,142,.5); background: rgba(62,207,142,.07); } .how-card.aws b { color: #6ee7b0; }
.how-note { margin-top: 1.1rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 18px; background: var(--soft); line-height: 1.6; }

@media (max-width: 900px) {
  .ov-grid.two, .ov-grid.three { grid-template-columns: 1fr; } .how-grid { grid-template-columns: repeat(2, 1fr); }
  .steps .tab { min-width: 33%; }
}

.how-card i { margin-bottom: .35rem; }
.steps .tab i { margin-bottom: .2rem; }
.agent-num { margin-right: .1rem; }

.agent.skipped .agent-num { background: transparent; border: 1px dashed var(--muted, #8a93a6); }
.agent.skipped .agent-state { color: var(--muted, #8a93a6); }

.privacy-box { margin: 14px 0; padding: 12px 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(255,255,255,.04); font-size: .85rem; text-align: left; }
.privacy-box p { margin: 6px 0 10px; opacity: .85; }
.privacy-box .consent { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 600; }
.privacy-box .consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
