/* ==========================================================================
   login.css — Sign-in, OTP, password, register
   Layout:  aurora background · top bar · product showcase (left) · glass card (right)
   The showcase hides below 1100px; the card stays centred.
   All colour comes from tokens, so light (default) and dark both work.
   ========================================================================== */

html:has(body[data-page="login"]) { overflow: hidden; height: 100%; }
body[data-page="login"] {
  --auth-bg: #F3F6FA;
  --blob-teal: rgba(31, 168, 176, 0.55);
  --blob-violet: rgba(122, 92, 224, 0.42);
  --blob-peach: rgba(246, 146, 90, 0.45);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-border: rgba(255, 255, 255, 0.9);
  --grid-line: rgba(20, 32, 39, 0.045);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 30px 80px -24px rgba(16, 52, 70, 0.30), 0 8px 24px -12px rgba(16, 52, 70, 0.14);
  --card-solid: #FFFFFF;
  --card-hero-shadow: 0 1px 0 #fff inset, 0 30px 70px -26px rgba(8, 84, 92, 0.45), 0 12px 30px -16px rgba(16, 52, 70, 0.26);
  height: 100vh; height: 100dvh; background: var(--auth-bg); overflow: hidden;
}
[data-theme="dark"] body[data-page="login"] {
  --auth-bg: #071013;
  --blob-teal: rgba(31, 168, 176, 0.34);
  --blob-violet: rgba(122, 92, 224, 0.30);
  --blob-peach: rgba(246, 146, 90, 0.20);
  --glass: rgba(19, 30, 34, 0.66);
  --glass-strong: rgba(19, 30, 34, 0.82);
  --glass-border: rgba(255, 255, 255, 0.08);
  --grid-line: rgba(255, 255, 255, 0.035);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 30px 80px -24px rgba(0, 0, 0, 0.7);
  --card-solid: #111C20;
  --card-hero-shadow: 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 40px 100px -24px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(31, 168, 176, 0.18);
}

/* ---------- Aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora__blob { position: absolute; border-radius: 50%; filter: blur(80px); will-change: transform; }
.aurora__blob--teal   { width: 52vw; height: 52vw; left: -12vw; top: -18vw; background: var(--blob-teal);   animation: drift-a 22s ease-in-out infinite alternate; }
.aurora__blob--violet { width: 46vw; height: 46vw; right: -10vw; top: 10vh;  background: var(--blob-violet); animation: drift-b 26s ease-in-out infinite alternate; }
.aurora__blob--peach  { width: 40vw; height: 40vw; left: 28vw; bottom: -22vw; background: var(--blob-peach);  animation: drift-c 24s ease-in-out infinite alternate; }
.aurora__grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
}
@keyframes drift-a { to { transform: translate(8vw, 6vh) scale(1.08); } }
@keyframes drift-b { to { transform: translate(-6vw, 10vh) scale(0.92); } }
@keyframes drift-c { to { transform: translate(-10vw, -6vh) scale(1.1); } }

/* ---------- Page grid ---------- */
.auth {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(400px, 480px);
  grid-template-rows: auto 1fr; column-gap: clamp(32px, 5vw, 80px);
  width: min(1360px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) var(--space-8);
}
.auth__top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; height: 88px; }
.auth__logo { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--color-text); }
.auth__logo:hover { text-decoration: none; }
body[data-page="login"] .auth__logo .brand-logo--full { display: block; height: 44px; background: rgba(255,255,255,.92); padding: 6px 14px; border-radius: 14px; box-sizing: content-box; box-shadow: 0 4px 16px -8px rgba(16,52,70,.25); }
.auth__top-actions { display: flex; align-items: center; gap: var(--space-2); }
.auth__help {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 var(--space-4);
  border-radius: var(--radius-pill); background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: var(--text-sm); font-weight: 600; color: var(--color-text-2);
}
.auth__help:hover { text-decoration: none; color: var(--color-text); }
.auth__round {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--color-text-2);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.auth__round:hover { color: var(--color-primary-text); }

/* ---------- Showcase ---------- */
.showcase { align-self: center; display: flex; flex-direction: column; padding: var(--space-6) 0 var(--space-10); }
.showcase__title {
  font-size: clamp(2.2rem, 3.6vw, 3.2rem); font-weight: 800; line-height: 1.06; letter-spacing: -0.04em;
  max-width: 15ch; color: var(--color-text);
}
.showcase__lead { margin-top: var(--space-4); font-size: var(--text-base); color: var(--color-text-2); max-width: 44ch; line-height: 1.6; }

.stage { position: relative; height: 330px; margin-top: var(--space-8); max-width: 560px; }
.float-card {
  position: absolute; display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-radius: 18px;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--card-shadow);
  transition: translate 400ms var(--ease-out);
  animation: bob 7s ease-in-out infinite;
}
.float-card strong { display: block; font-size: var(--text-sm); }
.fc-sub { display: block; font-size: var(--text-xs); color: var(--color-text-muted); }
@keyframes bob { 50% { transform: translateY(-10px); } }

.float-card--main { left: 0; top: 30px; width: min(360px, 70%); flex-direction: column; align-items: stretch; gap: var(--space-4); padding: var(--space-5) var(--space-5) var(--space-3); border-radius: 24px; animation-duration: 8s; }
.fc-head { display: flex; align-items: center; gap: var(--space-3); }
.fc-head strong { font-size: var(--text-base); }
.fc-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--gradient-primary); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm); }
.fc-pill { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--color-success-soft); color: var(--color-success); font-size: 11px; font-weight: 700; }
.fc-scores { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.fc-scores > div { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); border-radius: 14px; background: color-mix(in srgb, var(--color-surface) 70%, transparent); border: 1px solid var(--color-border); }
.fc-bureau { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 600; color: var(--color-text-2); }
.fc-bureau i { width: 8px; height: 8px; border-radius: 3px; }
.fc-scores b { font-family: var(--font-display); font-size: 1.9rem; letter-spacing: -0.04em; line-height: 1.05; }
.fc-scores em { font-style: normal; font-size: var(--text-xs); font-weight: 700; }
.fc-scores em.up { color: var(--color-success); } .fc-scores em.down { color: var(--color-danger); }
.fc-scale { padding-top: 34px; }
.fc-scale .score-scale { --track-h: 10px; }
.fc-scale .score-marker__flag { font-size: 11px; padding: 3px 8px; }
.fc-scale .score-marker__flag b { font-size: var(--text-sm); }

.fc-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none; }
.fc-icon--mint   { background: var(--kpi-mint);   color: var(--color-success); }
.fc-icon--violet { background: var(--kpi-violet); color: var(--color-violet); }
.fc-icon--amber  { background: var(--kpi-amber);  color: var(--color-warning); }

.float-card--kpi { right: 0; top: -12px; padding: var(--space-4); animation-delay: -2s; }
.float-card--kpi b { display: block; font-family: var(--font-display); font-size: var(--text-xl); line-height: 1; }
.fc-bars { display: flex; align-items: flex-end; gap: 4px; height: 36px; margin-left: var(--space-2); }
.fc-bars i { width: 7px; height: var(--h); border-radius: 3px; background: linear-gradient(180deg, var(--kpi-bar-mint), color-mix(in srgb, var(--kpi-bar-mint) 40%, transparent)); }
.float-card--toast { right: 0; top: 150px; animation-delay: -4s; }
.float-card--pay   { right: 10%; bottom: -34px; animation-delay: -1s; }

.showcase__points { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-8); }
.showcase__points li {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 var(--space-4);
  border-radius: var(--radius-pill); background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: var(--text-sm); font-weight: 600; color: var(--color-text-2);
}
.showcase__points .icon { color: var(--color-primary); }

/* ---------- Sign-in card (the hero: largest, brightest, highest elevation) ---------- */
.auth__main { align-self: center; display: flex; flex-direction: column; align-items: center; padding: var(--space-6) 0; }
.auth__card {
  position: relative; width: 100%; max-width: 480px;
  padding: var(--space-8) var(--space-8) var(--space-6);
  border-radius: 26px;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(28px) saturate(1.5); -webkit-backdrop-filter: blur(28px) saturate(1.5);
  box-shadow: var(--card-shadow);
}
.auth__card-glow { /* strong brand halo so the card reads as the focal point */
  position: absolute; inset: -2px; z-index: -1; border-radius: 28px; pointer-events: none;
  background: conic-gradient(from 140deg, rgba(14, 124, 134, 0.55), rgba(122, 92, 224, 0.45), rgba(240, 122, 53, 0.45), rgba(14, 124, 134, 0.55));
  filter: blur(26px); opacity: 0.35;
}
.auth__card h1 { font-size: 2rem; line-height: 1.1; letter-spacing: -0.045em; }
.auth__lead { margin: var(--space-3) 0 var(--space-6); color: var(--color-text-2); font-size: var(--text-base); line-height: 1.5; max-width: none; }
.auth__back {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 8px; margin-bottom: var(--space-5);
  border-radius: var(--radius-pill); background: var(--color-surface-hover); color: var(--color-text-2);
  font-size: var(--text-sm); font-weight: 600;
}
.auth__back:hover { color: var(--color-text); }

/* Progress: two bars, labelled underneath (current step filled in brand teal) */
.steps { list-style: none; padding: 0; margin-top: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--space-3); margin-bottom: var(--space-6); }
.steps li { display: flex; flex-direction: column; gap: 10px; font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); }
.steps li::before { content: ""; order: -1; height: 5px; border-radius: var(--radius-pill); background: var(--color-bg-sunken); box-shadow: inset 0 0 0 1px var(--color-border); transition: background var(--dur-slow); }
.steps li.is-active { color: var(--color-text); }
.steps li.is-active::before, .steps li.is-done::before { background: var(--gradient-primary); box-shadow: none; }
.steps li.is-done { color: var(--color-primary-text); }

/* "or" divider + secondary route */
.or { display: flex; align-items: center; gap: var(--space-4); margin: var(--space-6) 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--color-border-strong); }
.alt { --btn-bd: var(--color-border-strong); font-weight: 700; }
.alt .icon { color: var(--color-primary); }
.alt:hover:not(:disabled) { --btn-bd: var(--color-primary); }

/* Phone / text input group */
.phone {
  position: relative; display: flex; align-items: center; height: 56px;
  border: 1.5px solid var(--color-input-border); border-radius: 14px; background: var(--color-surface);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.phone:hover { border-color: var(--color-text-2); }
.phone:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 5px var(--focus-halo); }
.field.is-invalid .phone { border-color: var(--color-danger); }
.field.is-invalid .phone:focus-within { box-shadow: 0 0 0 5px color-mix(in srgb, var(--color-danger) 16%, transparent); }
.phone__cc {
  display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 var(--space-4); font-size: var(--text-base);
  border-right: 1px solid var(--color-border); font-weight: 700; color: var(--color-text-2); flex: none;
}
.phone__cc--icon { padding: 0 14px; color: var(--color-text-muted); }
.flag { width: 20px; height: 14px; border-radius: 3px; background: linear-gradient(#FF9933 0 33.3%, #FFFFFF 33.3% 66.6%, #138808 66.6%); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); position: relative; }
.flag::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; border-radius: 50%; transform: translate(-50%, -50%); background: #000080; }
.phone__input {
  flex: 1; min-width: 0; height: 100%; padding: 0 var(--space-4); border: 0; background: transparent; outline: none;
  font-size: 1.125rem; font-weight: 600; letter-spacing: 0.06em; color: var(--color-text);
}
.phone__input--text { letter-spacing: 0; font-size: var(--text-base); font-weight: 500; }
.phone__input::placeholder { color: var(--color-text-muted); font-weight: 500; }
.phone__end { display: grid; place-items: center; width: 44px; height: 44px; margin-right: 6px; border-radius: 12px; color: var(--color-text-muted); }
.phone__end:hover { background: var(--color-surface-hover); color: var(--color-text); }

/* Primary CTA */
.btn--xl { height: 52px; border-radius: 14px; font-size: var(--text-base); }
.cta { height: 56px; font-weight: 700; margin-top: var(--space-1); }
.cta { justify-content: center; gap: 10px; background-size: 200% 100%; }
.cta .icon { transition: transform var(--dur-base) var(--ease-out); }
.cta:hover:not(:disabled) .icon { transform: translateX(4px); }

/* OTP step */
.auth .otp { gap: 10px; }
.auth .otp input { height: 60px; aspect-ratio: auto; max-height: none; border-radius: 16px; font-size: 1.6rem; background: var(--color-surface); }
.auth .otp input:focus { box-shadow: 0 0 0 5px var(--focus-halo); }

.demo-note {
  display: flex; align-items: flex-start; gap: 8px; margin-top: var(--space-6); padding: var(--space-3) var(--space-4);
  border-radius: 14px; background: color-mix(in srgb, var(--color-info-soft) 80%, transparent); color: var(--color-text-2); font-size: var(--text-sm);
}
.demo-note .icon { color: var(--color-info); margin-top: 2px; }

.auth__foot { margin-top: var(--space-5); text-align: center; font-size: var(--text-sm); color: var(--color-text-2); max-width: none; }
.auth__foot a { font-weight: 700; }
.auth__legal { margin: var(--space-6) auto 0; padding-top: var(--space-6); border-top: 1px solid var(--color-border); text-align: center; font-size: var(--text-xs); line-height: 1.6; color: var(--color-text-2); max-width: 44ch; }
.auth__legal a { font-weight: 600; }
.auth__card:has([data-step="done"]:not([hidden])) .auth__legal { display: none; }

.auth-step { animation: step-in 420ms var(--ease-out); }
@keyframes step-in { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }

/* Success state */
.auth-step--done { text-align: center; padding: var(--space-4) 0; }
.done-ring { width: 88px; height: 88px; margin: 0 auto var(--space-5); }
.done-ring svg { width: 100%; height: 100%; }
.done-ring circle { fill: var(--color-success-soft); stroke: var(--color-success); stroke-width: 4; stroke-dasharray: 227; stroke-dashoffset: 227; animation: draw 700ms var(--ease-out) forwards; }
.done-ring path { fill: none; stroke: var(--color-success); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw 400ms 500ms var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.progress-line { height: 4px; margin: var(--space-6) auto 0; width: 60%; border-radius: var(--radius-pill); background: var(--color-bg-sunken); overflow: hidden; }
.progress-line span { display: block; height: 100%; width: 0; background: var(--gradient-primary); animation: fill 1.3s var(--ease-out) forwards; }
@keyframes fill { to { width: 100%; } }

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .auth { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .showcase { display: none; }
  .auth__main { width: 100%; }
}
@media (max-width: 520px) {
  .auth__top { height: 72px; }
  .auth__help span { display: none; }
  .auth__help { width: 40px; padding: 0; justify-content: center; }
  .brand-name small { display: none; }
  .auth__card { padding: var(--space-8) var(--space-5) var(--space-6); border-radius: 26px; }
  .phone__input { font-size: 1.05rem; }
  .auth .otp { gap: 6px; }
  .auth .otp input { height: 54px; font-size: 1.3rem; border-radius: 12px; }
  .aurora__blob { filter: blur(60px); }
}
@media (prefers-reduced-motion: reduce) {
  .aurora__blob, .float-card { animation: none; }
}

/* Glass refinements: inner pieces stay readable on the frosted surface */
.steps li::before { background: color-mix(in srgb, var(--color-bg-sunken) 70%, transparent); }
.alt { --btn-bg: color-mix(in srgb, var(--color-surface) 78%, transparent); }
.or::before, .or::after { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.auth__legal { border-top-color: color-mix(in srgb, var(--color-text) 10%, transparent); }


/* ==========================================================================
   No page scroll: the sign-in screen is locked to the viewport height.
   Spacing scales with viewport height so every step fits without scrolling.
   If the screen is extremely short, only the card scrolls internally.
   ========================================================================== */
.auth {
  height: 100vh; height: 100dvh; min-height: 0; overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr); padding-bottom: 0;
}
.auth__top { height: clamp(56px, 10vh, 88px); }
.showcase { min-height: 0; padding: 0 0 var(--space-4); justify-content: center; }
.stage { height: clamp(240px, 38vh, 330px); margin-top: clamp(var(--space-4), 4vh, var(--space-8)); }
.showcase__points { margin-top: clamp(var(--space-6), 6vh, var(--space-8)); }
.auth__main { min-height: 0; padding: 0 0 clamp(var(--space-3), 3vh, var(--space-6)); justify-content: center; }
.auth__card {
  max-height: 100%; overflow-y: auto; scrollbar-width: none;
  padding: clamp(var(--space-5), 4vh, var(--space-8)) var(--space-8) clamp(var(--space-4), 3vh, var(--space-6));
}
.auth__card::-webkit-scrollbar { display: none; }
.auth__card h1 { font-size: clamp(1.6rem, 3.6vh, 2rem); }
.auth__lead { margin: var(--space-2) 0 clamp(var(--space-4), 3vh, var(--space-6)); }
.steps { margin-bottom: clamp(var(--space-4), 3vh, var(--space-6)); }
.or { margin: clamp(var(--space-3), 2.4vh, var(--space-6)) 0; }
.auth__back { margin-bottom: clamp(var(--space-3), 2vh, var(--space-5)); }
.demo-note { margin-top: clamp(var(--space-3), 2.4vh, var(--space-6)); }
.auth__legal { margin-top: clamp(var(--space-3), 2.4vh, var(--space-6)); padding-top: clamp(var(--space-3), 2.4vh, var(--space-6)); }
.auth__foot { margin-top: clamp(var(--space-3), 2vh, var(--space-5)); }
.auth .stack.gap-4 { gap: clamp(var(--space-3), 2vh, var(--space-4)); }
.phone { height: clamp(48px, 7vh, 56px); }
.cta { height: clamp(48px, 7vh, 56px); }
.btn--xl { height: clamp(46px, 6.6vh, 52px); }
.auth .otp input { height: clamp(48px, 7.4vh, 60px); }
@media (max-height: 760px) { .auth__legal { display: none; } }
@media (max-height: 620px) { .field__hint { display: none; } .demo-note { display: none; } }
@media (max-width: 520px) { .auth__card { padding-left: var(--space-5); padding-right: var(--space-5); } }

/* Showcase on shorter desktop screens: drop the chips and shrink the lead so the floating cards never collide */
@media (max-height: 860px) {
  .showcase__points { display: none; }
  .stage { height: 300px; }
}
@media (max-height: 700px) {
  .showcase__lead { display: none; }
  .stage { height: 280px; margin-top: var(--space-6); }
  .float-card--pay { display: none; }
}

/* ---------- Sign-in card: plain white ---------- */
.auth__card { background: #fff; border-color: var(--color-border); backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-theme="dark"] .auth__card { background: var(--color-surface); }
