/* ============================================================
   AUTH — split-screen account pages (auth_base.html), after CrucialZone's login.
   Left: a navy "live board meeting" stage — one meeting travelling
   Agenda > Board Book > Vote > Signed on a loop.
   Right: the form, floating labels, nothing else competing.
   The site nav and footer are hidden on these pages; the logo sits above the form.
   Loaded only by auth_base.html, after styles.css, so it overrides the older .auth-* rules.
   ============================================================ */
body.auth-page { background: var(--card, #fff); }
body.auth-page > .vn, body.auth-page > .footer { display: none; }
.auth { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); min-height: 100vh; }

/* --- left stage --- */
.auth-stage {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(120% 90% at 0% 0%, #13365a 0%, #0b2036 55%, #06121f 100%);
  display: flex; align-items: center; justify-content: center; padding: 56px 48px;
}
.auth-stage .fa-duotone { --fa-primary-color: currentColor; --fa-secondary-color: currentColor; }
.auth-aurora {
  position: absolute; inset: -30%; pointer-events: none; filter: blur(60px); opacity: .55;
  background:
    radial-gradient(30% 30% at 30% 35%, rgba(12,100,174,.9), transparent 70%),
    radial-gradient(25% 25% at 70% 65%, rgba(94,167,224,.55), transparent 70%),
    radial-gradient(20% 22% at 60% 20%, rgba(56,189,248,.35), transparent 70%);
  animation: authDrift 22s ease-in-out infinite alternate;
}
.auth-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 70% at 50% 50%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000 30%, transparent 100%);
}
@keyframes authDrift {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { transform: translate(6%, -4%) rotate(18deg) scale(1.1); }
}
.auth-stage-inner { position: relative; width: 100%; max-width: 500px; }
.auth-kicker {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.06);
  font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #cfe3f6;
  backdrop-filter: blur(6px);
}
.auth-live { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: authPing 1.8s infinite; }
@keyframes authPing { 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.auth-headline {
  margin: 22px 0 40px; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.08; font-weight: 700; letter-spacing: -.025em; color: #fff;
}
.auth-headline em {
  font-style: normal;
  background: linear-gradient(90deg, #7cc4ff, #5ea7e0 40%, #a5f3fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* the four-stage track: the fill sweeps across, each node lights as it is reached */
.auth-track { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 34px; }
.auth-rail { position: absolute; top: 21px; left: 12.5%; right: 12.5%; height: 2px; background: rgba(255,255,255,.12); border-radius: 2px; }
.auth-rail-fill {
  height: 100%; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, #5ea7e0, #a5f3fc); box-shadow: 0 0 12px rgba(165,243,252,.7);
  animation: authFill 8s cubic-bezier(.65,0,.35,1) infinite;
}
@keyframes authFill { 0%,6% { width: 0; } 28% { width: 33.3%; } 50% { width: 66.6%; } 72%,90% { width: 100%; opacity: 1; } 100% { width: 100%; opacity: 0; } }
.auth-node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; font-size: .8rem; font-weight: 600; color: rgba(255,255,255,.55); text-align: center; }
.auth-node > i, .auth-node > svg {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.05rem; box-sizing: border-box; padding: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.6);
  animation: authNode 8s infinite; animation-delay: calc(var(--i) * 1.76s);
}
.auth-node span { animation: authNodeTxt 8s infinite; animation-delay: calc(var(--i) * 1.76s); }
@keyframes authNode {
  0%, 4%   { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: rgba(255,255,255,.6); box-shadow: none; transform: scale(1); }
  9%       { transform: scale(1.12); }
  12%, 80% { background: #0c64ae; border-color: #7cc4ff; color: #fff; box-shadow: 0 0 0 6px rgba(94,167,224,.16), 0 8px 24px rgba(12,100,174,.55); transform: scale(1); }
  100%     { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: rgba(255,255,255,.6); box-shadow: none; }
}
@keyframes authNodeTxt { 0%,4% { color: rgba(255,255,255,.55); } 12%,80% { color: #fff; } 100% { color: rgba(255,255,255,.55); } }

/* the meeting card: glass, floating, the readiness ring fills on the loop */
.auth-cards { position: relative; padding-top: 14px; }
.auth-tcard {
  position: relative; z-index: 1; padding: 18px 20px; border-radius: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,.13), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.12);
  animation: authFloat 7s ease-in-out infinite;
}
.auth-tcard-back {
  position: absolute; z-index: 0; top: 0; left: 22px; right: 22px; height: 70px; padding: 14px 18px;
  opacity: .5; animation: authFloat 7s ease-in-out infinite reverse;
}
.auth-tline { height: 7px; border-radius: 4px; background: rgba(255,255,255,.2); margin-bottom: 7px; }
.auth-tline.w60 { width: 60%; }
.auth-tline.w40 { width: 40%; }
@keyframes authFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.auth-tcard-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.auth-chip { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: rgba(94,167,224,.22); color: #bfe0fb; }
.auth-due { font-size: .76rem; color: #fcd34d; display: inline-flex; align-items: center; gap: 6px; }
.auth-ttitle { font-size: 1.02rem; font-weight: 650; line-height: 1.35; color: #fff; }
.auth-tmeta { font-size: .8rem; color: rgba(255,255,255,.55); margin-top: 3px; }
.auth-tfoot { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.auth-ring { position: relative; width: 46px; height: 46px; flex-shrink: 0; }
.auth-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.auth-ring circle { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 3.2; }
.auth-ring .auth-ring-fill {
  stroke: #34d399; stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: 97.4;
  animation: authRing 8s ease-out infinite;
}
@keyframes authRing { 0%,24% { stroke-dashoffset: 97.4; } 46%,90% { stroke-dashoffset: 21.6; } 100% { stroke-dashoffset: 97.4; } }
.auth-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .78rem; color: #fff; }
.auth-tfit { display: flex; flex-direction: column; line-height: 1.3; }
.auth-tfit strong { font-size: .9rem; color: #6ee7b7; }
.auth-tfit span { font-size: .78rem; color: rgba(255,255,255,.6); }

/* --- right panel --- */
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 28px 24px; background: var(--card, #fff); }
.auth-box { width: 100%; max-width: 380px; margin: auto 0; animation: authRise .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes authRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth-logo { display: inline-block; }
.auth-logo img { height: 44px; width: auto; display: block; margin-bottom: 34px; }
.auth-logo .auth-logo-w { display: none; }
.auth-title { font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; color: var(--navy-900); line-height: 1.15; margin-bottom: 0; }
.auth-sub { color: var(--muted); margin: 6px 0 28px; font-size: .97rem; line-height: 1.5; }

/* floating-label field */
.fl { position: relative; margin-bottom: 14px; }
.fl input {
  width: 100%; height: 56px; padding: 22px 46px 6px 44px; box-sizing: border-box;
  font: inherit; font-size: .98rem; color: var(--navy-900);
  background: #f4f7fb; border: 1.5px solid transparent; border-radius: 12px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.fl input:hover { background: #eef3f9; }
.fl input:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(12,100,174,.12); }
.fl label {
  position: absolute; left: 44px; top: 50%; transform: translateY(-50%); transform-origin: left center; margin: 0;
  color: var(--muted); font-size: .96rem; font-weight: 400; pointer-events: none; transition: transform .15s, top .15s, color .15s;
}
.fl input:focus + label, .fl input:not(:placeholder-shown) + label { top: 17px; transform: translateY(-50%) scale(.78); font-weight: 600; }
.fl input:-webkit-autofill + label { top: 17px; transform: translateY(-50%) scale(.78); font-weight: 600; }
.fl input:focus + label { color: var(--accent); }
.fl-ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #8a94a6; font-size: 1rem; pointer-events: none; transition: color .15s; }
.fl:focus-within .fl-ic { color: var(--accent); }
.fl-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px;
  border: 0; border-radius: 9px; background: transparent; color: #8a94a6; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.fl-eye:hover { background: rgba(12,100,174,.08); color: var(--accent); }
.fl-eye.on { color: var(--accent); }
.fl.bad input { border-color: var(--danger); background: #fff; animation: authShake .32s; }
.fl.bad label, .fl.bad .fl-ic { color: var(--danger); }
@keyframes authShake { 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
.fl-caps { margin: -6px 0 10px 4px; font-size: .8rem; color: #b87c0a; display: flex; align-items: center; gap: 6px; }
/* the 2FA code: one big centred box, no icon */
.fl.fl-code input { padding: 22px 16px 6px; text-align: center; font-family: monospace; font-size: 1.35rem; letter-spacing: 8px; }
.fl.fl-code label { left: 0; right: 0; text-align: center; transform-origin: center; }

.auth-row { display: flex; justify-content: flex-end; align-items: center; margin: 2px 0 22px; font-size: .86rem; }
.auth-row a { font-weight: 600; color: var(--accent); }

.auth-go {
  position: relative; width: 100%; min-height: 52px; border-radius: 12px; font-size: 1rem; color: #fff; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600;
  background: linear-gradient(135deg, var(--accent) 0%, #0a3f6e 100%);
  box-shadow: 0 10px 24px -8px rgba(12,100,174,.6); overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.auth-go::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-20deg); transition: left .55s;
}
.auth-go:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -8px rgba(12,100,174,.7); color: #fff; text-decoration: none; }
.auth-go:hover::after { left: 120%; }
.auth-go:active { transform: translateY(0); }
.auth-go-arrow { transition: transform .15s; }
.auth-go:hover .auth-go-arrow { transform: translateX(4px); }
.auth-go-spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: authSpin .7s linear infinite; }
.auth-go.busy .auth-go-arrow { display: none; }
.auth-go.busy .auth-go-spin { display: inline-block; }
.auth-go.busy[disabled] { opacity: .9; cursor: progress; }
@keyframes authSpin { to { transform: rotate(360deg); } }
/* the other account pages' plain submit button gets the same look */
.auth-box .auth-submit { min-height: 52px; border-radius: 12px; background: linear-gradient(135deg, var(--accent) 0%, #0a3f6e 100%);
  border: 0; box-shadow: 0 10px 24px -8px rgba(12,100,174,.6); }

.auth-box .social-auth { margin-top: 22px; }
.auth-switch { margin-top: 26px; text-align: center; font-size: .92rem; color: var(--muted); }
.auth-switch a { font-weight: 600; color: var(--accent); }
.auth-switch a i, .auth-switch a svg { font-size: .8em; margin-left: 2px; transition: transform .15s; }
.auth-switch a:hover { text-decoration: none; }
.auth-switch a:hover i, .auth-switch a:hover svg { transform: translateX(3px); }
.auth-legal { margin-top: 28px; font-size: .78rem; color: #9aa3b2; }
.auth-legal a { color: #9aa3b2; }

/* dark theme: the form side follows the app's dark palette */
[data-theme="dark"] .fl input { background: rgba(255,255,255,.06); color: var(--ink); }
[data-theme="dark"] .fl input:hover { background: rgba(255,255,255,.09); }
[data-theme="dark"] .fl input:focus, [data-theme="dark"] .fl.bad input { background: rgba(255,255,255,.04); }
[data-theme="dark"] .auth-logo .auth-logo-c { display: none; }
[data-theme="dark"] .auth-logo .auth-logo-w { display: block; }

/* narrow: the stage collapses to a compact band above the form */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-stage { padding: 30px 24px 26px; }
  .auth-headline { margin: 14px 0 22px; font-size: 1.6rem; }
  .auth-headline br { display: none; }
  .auth-cards { display: none; }
  .auth-track { margin-bottom: 0; }
  .auth-panel { padding-top: 34px; }
  .auth-logo img { margin-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth *, .auth *::before, .auth *::after { animation: none !important; transition: none !important; }
  .auth-rail-fill { width: 100%; }
  .auth-ring .auth-ring-fill { stroke-dashoffset: 21.6; }
}
