/*
  Login / Register page (account/templates/account/login_register.html)
  Full-screen brand background (grid, circuit lines, feature sketches) + form card.
  Background behaviour lives in static/js/auth_background.js, form helpers in static/js/auth_form.js.
  Bootstrap stays loaded on this page for the cookie banner/modal, so classes that clash with it
  are prefixed: .auth-card, .auth-nav, .gh-alert.
*/
:root { --bg: #0f0f12; --card: #171718; --inner: #111112; --raise: #1d1d20; --yellow: #FFDF00; --text: #f4f4f6; --muted: #b4b4b9; --dim: #76767c; --line: rgba(255,255,255,.1); --red: #ff5c5c; --blue: #6aa8ff; --ease: cubic-bezier(.16,1,.3,1); --spring: cubic-bezier(.34,1.56,.64,1); --slide: 7s; }
* { box-sizing: border-box; }
*, *::before, *::after, button, input { font-family: "Outfit", sans-serif; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
img { display: block; }
h1, h2, h3, p, ul, ol { margin: 0; }
a:hover { color: inherit; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-48px); } }

/* ===== Full-screen background (custom, brand only: grid, circuit lines, UI sketches) ===== */
.stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--bg); }
.stage__glow { position: absolute; left: -520px; top: -560px; width: 1100px; height: 1100px; border-radius: 50%; background: radial-gradient(circle, rgba(255,223,0,.09), transparent 62%); animation: glow 16s ease-in-out infinite alternate; }
@keyframes glow { to { transform: translate(80px, 50px); } }
.stage__grid { position: absolute; left: -30%; right: -30%; bottom: -8%; height: 62%; background-image: linear-gradient(rgba(255,223,0,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,223,0,.055) 1px, transparent 1px); background-size: 72px 72px; transform: perspective(900px) rotateX(62deg); transform-origin: bottom; -webkit-mask-image: linear-gradient(to top, #000, transparent 85%); mask-image: linear-gradient(to top, #000, transparent 85%); animation: grid 5s linear infinite; }
@keyframes grid { to { background-position: 0 72px; } }
.traces { position: absolute; inset: 0; width: 100%; height: 100%; }
.traces .t { fill: none; stroke: rgba(255,223,0,.085); stroke-width: 1.5; }
.traces .n { fill: var(--bg); stroke: rgba(255,223,0,.28); stroke-width: 1.5; }
.traces .p { fill: none; stroke: var(--yellow); stroke-width: 2; stroke-linecap: round; stroke-dasharray: .05 1.2; stroke-dashoffset: .05; opacity: .75; animation: pulse var(--dur, 7s) linear infinite; animation-delay: var(--d, 0s); }
@keyframes pulse { to { stroke-dashoffset: -1.05; } }
.stage::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,15,18,.55), transparent 40%), linear-gradient(180deg, transparent 72%, var(--bg)); }

/* feature scenes, positioned in the same 1320 container as the content */
.bgc { position: relative; max-width: 1320px; height: 100%; margin: 0 auto; }
.scene, .tiles { display: none; }
.scene.is-on, .tiles.is-on { display: block; }
.scene { position: absolute; left: 660px; top: 50%; width: 900px; height: 700px; margin-top: -330px; }
.scene svg { width: 100%; height: 100%; overflow: visible; }
.scene .ln { fill: none; stroke: rgba(255,223,0,.34); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; }
.scene .ln--soft { stroke: rgba(255,255,255,.09); stroke-dasharray: 4 6; stroke-dashoffset: 0; opacity: 0; }
.scene .bx { fill: rgba(23,23,24,.94); stroke: rgba(255,255,255,.12); stroke-width: 1; }
.scene .bx--y { stroke: rgba(255,223,0,.65); }
.scene .sk { fill: rgba(255,255,255,.15); }
.scene .sk2 { fill: rgba(255,255,255,.08); }
.scene .sk--y { fill: var(--yellow); }
.scene .lbl { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; fill: var(--dim); }
.scene .lbl--y { fill: var(--yellow); }
.scene .txt { font-size: 14px; font-weight: 700; fill: var(--text); }
.scene .ico { color: var(--yellow); font-size: 18px; line-height: 1; }
.scene .bx, .scene .sk, .scene .sk2, .scene .fx { opacity: 0; }
.scene.is-on .ln { animation: draw 1.4s var(--ease) forwards; animation-delay: var(--d, 0s); }
.scene.is-on .ln--soft { animation: show .8s ease forwards; animation-delay: var(--d, 0s); }
.scene.is-on .bx, .scene.is-on .sk, .scene.is-on .sk2, .scene.is-on .fx { animation: show .6s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes show { to { opacity: 1; } }
.scene .radar { transform-origin: 430px 350px; animation: spin 6s linear infinite; }
.scene .ping { transform-box: fill-box; transform-origin: center; animation: ping 2.2s ease-out infinite; animation-delay: var(--pd, 0s); }
@keyframes ping { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(3); } }
.is-out { animation: out .45s ease forwards !important; }
@keyframes out { to { opacity: 0; } }

.ftile { position: absolute; display: grid; place-items: center; width: 62px; height: 62px; border: 1px solid rgba(255,223,0,.28); border-radius: 16px; background: var(--card); color: var(--yellow); font-size: 1.45rem; box-shadow: 0 18px 40px -20px #000; opacity: 0; transform: rotate(var(--r)); }
.tiles.is-on .ftile { animation: tileIn .7s var(--spring) forwards, bob 6s ease-in-out infinite; animation-delay: var(--d), calc(var(--d) + .7s); }
@keyframes tileIn { from { opacity: 0; transform: rotate(var(--r)) translateY(24px) scale(.8); } to { opacity: 1; transform: rotate(var(--r)); } }
@keyframes bob { 0%, 100% { opacity: 1; transform: rotate(var(--r)) translateY(0); } 50% { opacity: 1; transform: rotate(var(--r)) translateY(-9px); } }

.ghost { position: absolute; left: -6px; bottom: 9%; color: rgba(255,255,255,.028); font-size: clamp(110px, 13vw, 230px); font-weight: 900; letter-spacing: -.045em; line-height: 1; white-space: nowrap; pointer-events: none; }
.ghost.is-in { animation: slideIn 1s var(--ease) both; }

/* the knowledge-base style light sweep, runs across the whole screen when the feature changes */
.sweep { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(115deg, transparent 36%, rgba(255,255,255,.04) 45%, rgba(255,255,255,.11) 50%, rgba(255,255,255,.04) 55%, transparent 64%); transform: translateX(-120%); }
.sweep.is-run { animation: sweep 1.25s var(--ease) forwards; }
@keyframes sweep { to { transform: translateX(120%); } }

/* ===== Content (centred 1320) ===== */
.wrap { position: relative; z-index: 1; display: grid; grid-template-rows: auto 1fr auto; width: 100%; max-width: 1320px; min-height: 100vh; margin: 0 auto; padding: 22px 24px 76px; }

.auth-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; animation: fadeUp .6s var(--ease) both; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 900; }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.auth-nav__links { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(15,15,18,.55); backdrop-filter: blur(10px); }
.auth-nav__links a { padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; color: var(--muted); font-size: .86rem; font-weight: 700; transition: color .2s; }
.auth-nav__links a:hover { color: var(--text); }
.auth-nav__links a.is-active { border-color: rgba(255,223,0,.35); background: rgba(255,223,0,.12); color: var(--yellow); }

.main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: center; gap: 48px; padding: 36px 0; }

.hero { max-width: 620px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--yellow); font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 26px; height: 2px; border-radius: 2px; background: var(--yellow); }
.hero h1 { margin-top: 16px; font-size: clamp(2.6rem, 5.4vw, 4.8rem); font-weight: 900; letter-spacing: -.04em; line-height: .95; text-shadow: 0 4px 30px rgba(0,0,0,.45); animation: slideIn .9s var(--ease) both; }
.hero h1 span { display: block; color: var(--yellow); animation: slideIn .9s var(--ease) .1s both; }
.hero p { max-width: 500px; margin-top: 20px; color: var(--muted); font-size: 1.08rem; line-height: 1.6; animation: fadeUp .7s var(--ease) .25s both; }
.hero__list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; padding: 0; list-style: none; animation: fadeUp .7s var(--ease) .35s both; }
.hero__list li { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(15,15,18,.55); color: var(--text); font-size: .84rem; font-weight: 600; backdrop-filter: blur(8px); }
.hero__list i { color: var(--yellow); }

/* ===== Form card ===== */
.auth-card { padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: rgba(23,23,24,.86); box-shadow: 0 30px 70px -30px rgba(0,0,0,.8); backdrop-filter: blur(16px); animation: fadeUp .7s var(--ease) .15s both; }
.auth-card h2 { font-size: 1.7rem; font-weight: 900; letter-spacing: -.02em; }
.auth-card h2 span { color: var(--yellow); }
.auth-card__sub { margin-top: 6px; color: var(--muted); font-size: .94rem; }

.gh-alert { display: flex; gap: 10px; margin-top: 18px; padding: 12px 13px; border: 1px solid rgba(255,92,92,.35); border-radius: 13px; background: rgba(255,92,92,.08); color: #ffd0d0; font-size: .87rem; line-height: 1.45; animation: fadeUp .35s var(--ease) both; }
.gh-alert > i { flex: none; margin-top: 1px; color: var(--red); font-size: 1rem; }
.gh-alert b { display: block; font-weight: 800; }
.gh-alert--info { border-color: rgba(106,168,255,.35); background: rgba(106,168,255,.08); color: #d6e6ff; }
.gh-alert--info > i { color: var(--blue); }
.gh-alert--success { border-color: rgba(255,223,0,.35); background: rgba(255,223,0,.08); color: #fff4b0; }
.gh-alert--success > i { color: var(--yellow); }
.gh-alert__timer { margin-top: 6px; font-size: .78rem; font-weight: 700; }

form { display: grid; gap: 15px; margin-top: 22px; }
.field { display: grid; gap: 7px; }
.field__label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .84rem; font-weight: 700; }
.field__label a { color: var(--yellow); font-size: .8rem; font-weight: 600; }
.field__label a:hover { text-decoration: underline; }
.control { position: relative; }
.control > i.lead { position: absolute; top: 50%; left: 14px; color: var(--dim); transform: translateY(-50%); pointer-events: none; transition: color .2s; }
.gh-input { width: 100%; height: 50px; padding: 0 46px 0 42px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; outline: none; background: var(--inner); color: var(--text); font-size: .98rem; transition: border-color .2s, box-shadow .2s; }
.gh-input::placeholder { color: var(--dim); }
.gh-input:hover { border-color: rgba(255,255,255,.18); }
.gh-input:focus { border-color: rgba(255,223,0,.6); box-shadow: 0 0 0 4px rgba(255,223,0,.08); }
/* Browser autofill (hovering a saved suggestion, and after picking one): keep the dark field instead of
   Chrome's light blue. The inset shadow paints over the autofill colour, the long transition stops it
   from fading back in, and text-fill keeps the text light. */
.gh-input:-webkit-autofill,
.gh-input:-webkit-autofill:hover,
.gh-input:-webkit-autofill:focus,
.gh-input:-webkit-autofill:active,
.gh-input:autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: inset 0 0 0 100px var(--inner);
  -webkit-box-shadow: inset 0 0 0 100px var(--inner);
  transition: background-color 600000s 0s, color 600000s 0s, border-color .2s;
  font-family: "Outfit", sans-serif;
}
.gh-input:-webkit-autofill:focus { box-shadow: inset 0 0 0 100px var(--inner), 0 0 0 4px rgba(255,223,0,.08); -webkit-box-shadow: inset 0 0 0 100px var(--inner), 0 0 0 4px rgba(255,223,0,.08); }
.control:focus-within > i.lead { color: var(--yellow); }
.field.is-invalid .gh-input { border-color: rgba(255,92,92,.55); }
.field.is-invalid .control > i.lead { color: var(--red); }
.password-toggle { position: absolute; top: 50%; right: 7px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--dim); cursor: pointer; transform: translateY(-50%); }
.password-toggle:hover { background: rgba(255,255,255,.06); color: var(--text); }
.hint { display: flex; align-items: center; gap: 6px; color: var(--yellow); font-size: .78rem; font-weight: 600; }

.btn-main { display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; margin-top: 4px; border: 0; border-radius: 13px; background: var(--yellow); color: #111; font-size: 1rem; font-weight: 800; cursor: pointer; box-shadow: 0 10px 24px -14px rgba(255,223,0,.7); transition: transform .2s var(--ease), filter .2s; }
.btn-main:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-main i { transition: transform .2s var(--ease); }
.btn-main:hover i { transform: translateX(3px); }
.btn-main[disabled] { cursor: progress; transform: none; }
.spin { width: 18px; height: 18px; border: 2.5px solid rgba(0,0,0,.25); border-top-color: #111; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--dim); font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-ghost { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border: 1px solid rgba(255,223,0,.35); border-radius: 13px; background: rgba(255,223,0,.08); color: var(--yellow); font-size: .95rem; font-weight: 800; transition: background .2s; }
.btn-ghost:hover { background: rgba(255,223,0,.15); }

/* register extras */
.auth--register .hero h1 { font-size: clamp(2.4rem, 4.6vw, 4.1rem); }
.auth--register .auth-card form { gap: 13px; margin-top: 20px; }
.auth--register .auth-card .gh-input { height: 47px; }
.note { color: var(--dim); font-size: .76rem; }
.errorlist { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; color: #ffb3b3; font-size: .8rem; font-weight: 600; }
.errorlist li::before { content: "\F33A"; margin-right: 6px; font-family: "bootstrap-icons" !important; color: var(--red); }
.rules { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.rules li { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--dim); font-size: .74rem; font-weight: 700; transition: all .2s; }
.rules li::before { content: "\F28A"; font-family: "bootstrap-icons" !important; }
.rules li.is-ok { border-color: rgba(255,223,0,.35); background: rgba(255,223,0,.1); color: var(--yellow); }
.rules li.is-ok::before { content: "\F26A"; }
.ok { position: absolute; top: 50%; right: 48px; color: var(--yellow); transform: translateY(-50%) scale(0); transition: transform .3s var(--spring); }
.control.is-match .ok { transform: translateY(-50%) scale(1); }
.alt { margin-top: 18px; color: var(--muted); font-size: .9rem; text-align: center; }
.alt a { color: var(--yellow); font-weight: 700; }
.alt a:hover { text-decoration: underline; }
.steps { display: grid; gap: 10px; max-width: 460px; margin-top: 26px; padding: 0; list-style: none; counter-reset: s; animation: fadeUp .7s var(--ease) .35s both; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .92rem; counter-increment: s; }
.steps li::before { content: counter(s); display: grid; flex: none; place-items: center; width: 28px; height: 28px; border: 1px solid rgba(255,223,0,.35); border-radius: 9px; background: rgba(15,15,18,.6); color: var(--yellow); font-size: .8rem; font-weight: 900; backdrop-filter: blur(8px); }
.steps li:first-child::before { border-color: transparent; background: var(--yellow); color: #111; }
.steps b { color: var(--text); font-weight: 800; }
@media (max-width: 560px) { .auth--register .steps { display: none; } }

/* ===== Caption bar (what's on screen) ===== */
.caption { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.caption__text { min-width: 0; }
.caption__tag { display: inline-flex; align-items: center; gap: 7px; color: var(--yellow); font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.caption__title { margin-top: 6px; font-size: 1.15rem; font-weight: 800; }
.caption__title small { margin-left: 8px; color: var(--dim); font-size: .85rem; font-weight: 600; }
.caption__text.is-swap > * { animation: fadeUp .6s var(--ease) both; }
.caption__text.is-swap > *:nth-child(2) { animation-delay: .06s; }

.dots { display: flex; gap: 8px; }
.dots button { position: relative; width: 54px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
.dots button::before, .dots button i { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; border-radius: 3px; transform: translateY(-50%); }
.dots button::before { background: rgba(255,255,255,.18); }
.dots button i { right: auto; width: 0; background: var(--yellow); }
.dots button.is-past i { width: 100%; }
.dots button.is-on i { animation: fill var(--slide) linear forwards; }
.dots.is-paused button.is-on i { animation-play-state: paused; }
@keyframes fill { to { width: 100%; } }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .main { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 28px 0; }
  .hero h1 { font-size: clamp(2.2rem, 9vw, 3.2rem); }
  .hero p { font-size: 1rem; }
  .caption { grid-template-columns: minmax(0, 1fr); }
  .scene { left: 50%; top: 90px; margin: 0 0 0 -450px; opacity: .2; transform: scale(.8); transform-origin: top center; }
  .ftile { display: none; }
  .ghost { bottom: 20%; }
}
@media (max-width: 560px) {
  .wrap { padding: 16px 16px 120px; }
  .auth-nav__links a { padding: 7px 10px; font-size: .8rem; }
  .auth-card { padding: 22px 18px; }
  .hero__list { display: none; }
  .dots button { width: 40px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .scene .ln { stroke-dashoffset: 0; } .scene .bx, .scene .sk, .scene .sk2, .scene .fx, .scene .ln--soft, .ftile { opacity: 1; } }
