.auth-page {
  /* Blue is the action color; gold belongs to the existing brand artwork. */
  --auth-bg: #f6f9ff;
  --auth-surface: #fff;
  --auth-input: #f8faff;
  --auth-soft: #edf2ff;
  --auth-border: #7b8ca7;
  --auth-placeholder: #64738e;
  --entry-dark: #19306b;
  --entry-muted: #556681;
  --entry-blue: #3f63f0;
  --text: #15213a;
  --text-secondary: #556681;
  --primary: #3f63f0;
  --primary-light: #edf2ff;
  --primary-dark: #19306b;
  --error: #b42332;
  --success: #19704c;
  --auth-ease: cubic-bezier(.2,.75,.25,1);
  color-scheme: light;
  min-height: 100dvh;
  background: var(--auth-bg);
  color: var(--text);
}
.auth-page .auth-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--entry-muted); font-size: 13px; }
.auth-page .auth-topbar { height: 80px; min-height: 80px; max-width: 1160px; width: calc(100% - 80px); }
.auth-brand { position: relative; display: block; width: 174px; height: 52px; overflow: hidden; flex-shrink: 0; }
.auth-brand img { position: absolute; width: 228px; max-width: none; height: auto; left: -29px; top: -30px; }
.auth-page .auth-layout { width: calc(100% - 96px); max-width: 1040px; display: grid; grid-template-areas: 'story form'; grid-template-columns: minmax(0, 1fr) 440px; gap: 72px; align-items: start; min-height: calc(100dvh - 160px); margin: 24px auto 56px; padding-top: clamp(20px, 4vh, 44px); }
.auth-page .auth-story { grid-area: story; position: relative; padding: 52px 0 12px; display: grid; grid-template-columns: minmax(0, max-content); justify-content: start; align-content: start; max-width: 100%; min-width: 0; }
.auth-page .auth-story .entry-eyebrow { margin-bottom: 22px; color: var(--entry-blue); font-size: 11px; font-weight: 650; letter-spacing: .14em; line-height: 1.5; }
.auth-page .auth-story h2 { font-size: clamp(38px, 3.65vw, 52px); font-weight: 700; line-height: 1.3; letter-spacing: -.035em; }
.auth-page .auth-story h2 > .auth-title-line { display: block; color: var(--entry-dark); }
.auth-page .auth-story-description { font-size: 16px; line-height: 1.8; margin-top: 18px; color: var(--entry-muted); }
.auth-page .login-container { grid-area: form; width: 100%; max-width: 440px; padding: 0; min-width: 0; }
.auth-page .login-panel { padding: 36px; border: 1px solid #dce4f1; border-radius: 20px; background: var(--auth-surface); box-shadow: 0 16px 48px #233e7809; backdrop-filter: none; -webkit-backdrop-filter: none; }
.auth-page .login-header { margin: 0 0 28px; text-align: left; }
.auth-page .login-header h1 { font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.35; margin: 0 0 10px; text-wrap: balance; }
.auth-page .login-header p { font-size: 14px; line-height: 1.75; color: var(--entry-muted); }
.auth-page .auth-tabs { --auth-tab-index: 0; position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 0; padding: 4px; gap: 4px; border-radius: 12px; margin: 0 0 26px; background: #f0f4fb; }
.auth-page .auth-tabs::before { content: ''; position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 16px) / 3); border-radius: 8px; background: var(--auth-surface); box-shadow: 0 1px 5px #19306b12; transform: translateX(calc(var(--auth-tab-index) * (100% + 4px))); }
.auth-page.auth-motion-ready .auth-tabs::before { transition: transform 240ms var(--auth-ease); }
.auth-page .auth-tab { min-height: 44px; padding: 8px 6px; border: 0; border-radius: 8px; font-size: 14px; line-height: 1.5; font-weight: 550; color: var(--entry-muted); white-space: nowrap; background: transparent; transition: color 160ms ease, background 160ms ease, transform 160ms var(--auth-ease); }
.auth-page .auth-tab.active { background: transparent; color: var(--entry-blue); font-weight: 650; box-shadow: none; }
.auth-page .auth-tab:hover:not(.active) { background: var(--auth-input); color: var(--entry-dark); }
.auth-page .form-group { margin-bottom: 20px; }
.auth-page .form-group label { font-size: 14px; font-weight: 550; margin-bottom: 9px; line-height: 1.5; }
.auth-page .form-group input { min-height: 52px; padding: 13px 14px; border: 1px solid var(--auth-border); border-radius: 10px; font-size: 16px; line-height: 1.5; background: var(--auth-input); color: var(--text); }
.auth-page .form-group input::placeholder { color: var(--auth-placeholder); opacity: 1; }
.auth-page .form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #3f63f018; outline: 2px solid var(--primary); outline-offset: 2px; }
.auth-page .password-field input { padding-right: 54px; }
.auth-page .password-toggle { width: 44px; height: 44px; justify-content: center; right: 5px; padding: 0; border-radius: 8px; color: var(--entry-muted); }
.auth-page .password-toggle:hover { background: var(--auth-soft); }
.auth-page .auth-submit { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 52px; padding: 12px 16px; border-radius: 10px; font-size: 16px; font-weight: 650; line-height: 1.5; white-space: nowrap; color: #fff; background: var(--primary); box-shadow: none; transition: background 160ms ease, transform 180ms var(--auth-ease), opacity 160ms ease; }
.auth-page .auth-submit:hover:not(:disabled) { background: #3155dc; }
.auth-page .auth-submit:disabled { opacity: .72; }
.auth-page :is(.auth-submit,.code-btn,.auth-tab):active:not(:disabled) { transform: scale(.985); transition-duration: 80ms; }
.auth-page .code-btn { transition: background 160ms ease, transform 180ms var(--auth-ease); }
.auth-page #auth-form[aria-busy=true] .auth-submit::after { content: ''; width: 13px; height: 13px; border: 2px solid #ffffff60; border-right-color: #fff; border-radius: 50%; animation: auth-working 700ms linear infinite; }
@keyframes auth-working { to { transform: rotate(360deg); } }
.auth-page .auth-error, .auth-page .auth-info { font-size: 13px; line-height: 1.7; border-radius: 8px; margin: 0 0 16px; padding: 10px 12px; overflow-wrap: anywhere; }
.auth-page .auth-error { background: #fff0f1; color: var(--error); }
.auth-page .auth-info { background: #eef8f2; color: var(--success); }
.auth-page .code-field { align-items: stretch; gap: 8px; }
.auth-page .code-btn { border-color: var(--auth-border); background: var(--auth-soft); color: var(--primary-dark); border-radius: 10px; padding: 10px 12px; font-size: 13px; min-height: 48px; }
.auth-page .demo-hint { background: transparent; margin: 16px 0 0; padding: 0 12px; font-size: 13px; color: var(--entry-muted); }
.auth-page .auth-trial-link { margin: 22px 0 0; font-size: 13px; line-height: 1.8; color: var(--entry-muted); text-align: center; }
.auth-page .auth-trial-link a { display: inline-flex; gap: 9px; min-height: 44px; align-items: center; color: var(--entry-blue); font-weight: 550; }
.auth-page .auth-trial-link a span { transition: transform 180ms var(--auth-ease); }
.auth-page .auth-trial-link a:hover span { transform: translateX(3px); }
.auth-page .auth-trial-link a:hover { text-decoration: underline; text-underline-offset: 4px; }
.auth-page .password-guidance { gap: 6px; }
.auth-page .password-guidance-hint, .auth-page .password-confirmation { white-space: normal; }
.auth-page :focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.auth-page .auth-error:focus { outline: 2px solid var(--error); outline-offset: 2px; }
/* Match the destination surface so the brand hold and page reveal share one background. */
.auth-page .brand-loader .loader-brand { animation: none; }
.auth-page .brand-loader { background-color: inherit; background-image: inherit; background-size: inherit; background-repeat: inherit; }
/* One 3D brand film, with a static fallback while WebGL is unavailable. */
.coin-theatre { --cycle: 4s; --coin: 180px; --flight-lift: -34px; position: relative; width: 100%; min-width: 0; contain: inline-size; height: 260px; margin: 4px 0 0; pointer-events: none; isolation: isolate; }
.coin-webgl { display: none; position: absolute; inset: 0; width: 100%; height: 100%; }
.has-3d-coin .coin-webgl { display: block; }
.has-3d-coin > :not(.coin-webgl) { display: none !important; animation: none !important; }
.coin-fallback { position: absolute; inset: 0; overflow: hidden; }
/* Match the orthographic scene's height and centre at every viewport size. */
.coin-fallback img { position: absolute; left: 50%; width: auto; max-width: none; height: 100%; transform: translateX(-50%); }

.auth-brand-intro { position: fixed; z-index: 90; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: #edf3ff; pointer-events: none; }
.auth-brand-intro p { font-size: 13px; color: #63779c; letter-spacing: .04em; }
.auth-entering .auth-brand-intro { animation: auth-intro-away 360ms ease both; }
.auth-entering .intro-brand { animation: auth-mark-arrive 360ms var(--auth-ease) both; }
.auth-entering .auth-layout { animation: auth-form-arrive 440ms var(--auth-ease) both; }
@keyframes auth-intro-away { 0%,40% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
@keyframes auth-mark-arrive { from { opacity: 0; transform: perspective(600px) rotateY(-65deg) translateY(14px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes auth-line-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes auth-form-arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .auth-page *, .auth-page *::before, .auth-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .auth-brand-intro { display: none !important; }
  .coin-theatre *, .coin-theatre *::after { animation: none !important; }
}


@media (min-width: 761px) and (max-width: 1040px) {
  .auth-page .auth-layout { width: calc(100% - 64px); grid-template-columns: minmax(0, 1fr) minmax(340px, 390px); gap: 32px; }
  .auth-page .login-panel { padding: 28px; }
  .auth-page .auth-story h2 { font-size: 36px; }
  .auth-page .auth-story .entry-eyebrow { font-size: 9px; letter-spacing: .07em; }
  .auth-page .auth-story-description { font-size: 13px; }
  .auth-page .login-header h1 { font-size: 28px; }
}
@media (max-width: 760px) {
  .auth-page .auth-topbar { width: calc(100% - 40px); min-height: 72px; height: 72px; }
  .auth-brand { width: 145px; height: 44px; }
  .auth-brand img { width: 190px; left: -24px; top: -25px; }
  .auth-page .auth-layout { width: calc(100% - 40px); max-width: 440px; display: flex; flex-direction: column; min-height: 0; gap: 44px; margin: 20px auto 40px; padding-top: 0; }
  .auth-page .login-container { width: 100%; }
  .auth-page .login-panel { padding: 26px 24px; border-radius: 16px; }
  .auth-page .login-header { margin-bottom: 24px; }
  .auth-page .login-header h1 { font-size: 28px; }
  .auth-page .login-header p { font-size: 14px; }
  .auth-page .auth-tabs { margin-bottom: 24px; }
  .auth-page .auth-tab { font-size: 13px; }
  .auth-page .auth-trial-link { margin-top: 14px; }
  .auth-page .auth-story { width: 100%; max-width: 100%; justify-content: center; padding: 12px 0 0; min-height: 0; }
  .auth-page .auth-story h2 { font-size: 34px; }
  .auth-page .auth-story .entry-eyebrow { font-size: 10px; letter-spacing: .08em; margin-bottom: 16px; }
  .auth-page .auth-story-description { font-size: 13px; margin-top: 18px; }
  .coin-theatre { --coin: 150px; --flight-lift: -28px; height: 220px; margin: 0; }
}
@media (max-width: 360px) {
  .auth-page .auth-topbar { width: calc(100% - 24px); }
  .auth-brand { width: 132px; }
  .auth-page .auth-layout { width: calc(100% - 24px); }
  .auth-page .login-panel { padding: 24px 20px; }
  .auth-page .auth-story h2 { font-size: 30px; }
  .auth-page .auth-story-description { font-size: 12px; }
}
