/* AUTH-SWITCH-V1 — the sign-in page.
   A white card on the fractal-glass backdrop. Wide screens: sign in on the
   left, a glass panel on the right; choosing Sign up slides the panel across
   (its text slides the other way for depth) and reveals the access card.
   Phones: a sliding-pill tab bar and panels that slide sideways. */
:root {
  --au-grad: linear-gradient(135deg, #4338CA 0%, #6366F1 50%, #8B5CF6 100%);
  --au-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --au-ink: #17171C; --au-ink-2: #4B4D5A; --au-ink-3: #666876;
  --au-surface: #FFFFFF; --au-field: #F6F6F8; --au-border: #E3E4EA;
  --sg1: 99, 102, 241; --sg1a: .55; --sg2: 139, 92, 246; --sg2a: .36; --sg3: 34, 211, 238; --sg3a: .26;
}
html[data-daypart="morning"] { --sg1: 56, 189, 248; --sg1a: .50; --sg2: 45, 212, 191; --sg2a: .32; --sg3: 129, 140, 248; --sg3a: .34; }
html[data-daypart="evening"] { --sg1: 244, 114, 182; --sg1a: .40; --sg2: 139, 92, 246; --sg2a: .42; --sg3: 251, 146, 60; --sg3a: .28; }
html[data-daypart="night"] { --sg1: 79, 70, 229; --sg1a: .46; --sg2: 126, 34, 206; --sg2a: .28; --sg3: 30, 64, 175; --sg3a: .32; }
@media (prefers-color-scheme: dark) {
  :root { --au-ink: #ECECF1; --au-ink-2: #B4B5C0; --au-ink-3: #8A8B95; --au-surface: #141418; --au-field: #1C1C22; --au-border: rgba(255, 255, 255, .10); }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.au-body {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px;
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--au-ink);
  -webkit-font-smoothing: antialiased; background: #0B0B0F;
}

/* fractal glass backdrop: grain, ribbed refraction, Pulse light that follows the time of day */
.au-bg { position: fixed; inset: 0; z-index: -1; background-color: #0E0E12;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>"),
    repeating-linear-gradient(98deg, rgba(255,255,255,.05) 0 1.5px, rgba(255,255,255,0) 1.5px 7px, rgba(0,0,0,.22) 7px 9px, rgba(0,0,0,0) 9px 17px),
    radial-gradient(45% 45% at 14% 12%, rgba(var(--sg1), var(--sg1a)), rgba(var(--sg1), 0) 70%),
    radial-gradient(50% 55% at 88% 40%, rgba(var(--sg2), var(--sg2a)), rgba(var(--sg2), 0) 72%),
    radial-gradient(40% 40% at 60% 100%, rgba(var(--sg3), var(--sg3a)), rgba(var(--sg3), 0) 70%),
    linear-gradient(180deg, #14141B 0%, #0E0E12 55%, #0B0B0F 100%);
}

/* the card */
.au {
  position: relative; width: min(960px, 100%); height: 620px; border-radius: 30px; overflow: hidden; isolation: isolate;
  background: var(--au-surface);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 50px 120px -40px rgba(0, 0, 0, .85), 0 20px 50px -30px rgba(67, 56, 202, .5);
}
.au-tabs { display: none; }

.au-panel {
  position: absolute; top: 0; width: 50%; height: 100%; padding: 46px 56px; display: flex; flex-direction: column; justify-content: center;
  transition: opacity 480ms ease, transform 760ms var(--au-ease);
}
.au-signin { left: 0; }
.au-signup { left: 50%; opacity: 0; transform: translateX(-28px); }
.au[data-mode="signup"] .au-signin { opacity: 0; transform: translateX(28px); }
.au[data-mode="signup"] .au-signup { opacity: 1; transform: none; transition-delay: 120ms; }

.au-logo { height: 38px; width: auto; align-self: flex-start; margin-bottom: 26px; }
@media (prefers-color-scheme: dark) { .au-logo { filter: brightness(0) invert(1); opacity: .92; } }
.au h1 { margin: 0; font-size: 32px; font-weight: 600; letter-spacing: -.025em; line-height: 1.1; }
.au-sub { margin: 8px 0 24px; font-size: 15px; color: var(--au-ink-3); }

.au-flash { margin: -8px 0 16px; padding: 11px 14px; border-radius: 14px; font-size: 14px; }
.au-flash-error { color: #B91C1C; background: rgba(239, 68, 68, .09); box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .22); }
.au-flash-success, .au-flash-info { color: #15803D; background: rgba(34, 197, 94, .10); box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .22); }

.au-form { display: flex; flex-direction: column; gap: 14px; }
.au-field { display: grid; gap: 7px; margin: 0; }
.au-field > span:first-child { font-size: 13px; font-weight: 500; color: var(--au-ink-2); }
.au-field input {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--au-border); background: var(--au-field);
  font: inherit; font-size: 15px; color: var(--au-ink); outline: none; transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.au-field input::placeholder { color: var(--au-ink-3); opacity: .75; }
.au-field input:focus { border-color: #818CF8; background: var(--au-surface); box-shadow: 0 0 0 4px rgba(99, 102, 241, .16); }
.au-pass { position: relative; display: block; }
.au-pass input { padding-right: 52px; }
.au-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--au-ink-3); cursor: pointer; display: grid; place-items: center; }
.au-eye:hover { color: var(--au-ink); background: rgba(99, 102, 241, .08); }
.au-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.au-eye .eye-shut, .au-eye[aria-pressed="true"] .eye-open { display: none; }
.au-eye[aria-pressed="true"] .eye-shut { display: block; }
.au-row { display: flex; justify-content: flex-end; margin-top: -4px; }
.au-link { font-size: 13.5px; font-weight: 500; color: #4F46E5; text-decoration: none; }
.au-link:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-color-scheme: dark) { .au-link { color: #A5B4FC; } }

.au-btn {
  height: 50px; border: 0; border-radius: 999px; padding: 0 26px; font: inherit; font-size: 15.5px; font-weight: 600; cursor: pointer; color: #fff;
  background: var(--au-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 12px 26px -14px rgba(79, 70, 229, .9);
  transition: transform 200ms var(--au-ease), box-shadow 200ms ease, filter 200ms ease;
}
.au-btn:hover { filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 16px 32px -14px rgba(79, 70, 229, 1); }
.au-btn:active { transform: scale(.98); }
.au-btn:focus-visible, .au-tabs button:focus-visible, .au-eye:focus-visible, .au-link:focus-visible { outline: 2px solid #6366F1; outline-offset: 3px; }
.au-btn-ghost { color: var(--au-ink); background: var(--au-field); box-shadow: inset 0 0 0 1px var(--au-border); }
.au-btn-ghost:hover { box-shadow: inset 0 0 0 1px #C7D2FE; }
.au-note { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-size: 13px; color: var(--au-ink-3); }
.au-note svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* the access card on the sign-up side */
.au-admin-card {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; margin-bottom: 22px; padding: 20px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(99, 102, 241, .08), rgba(139, 92, 246, .04)); box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .16), inset 0 1px 0 rgba(255, 255, 255, .7);
}
@media (prefers-color-scheme: dark) { .au-admin-card { box-shadow: inset 0 0 0 1px rgba(165, 180, 252, .18); } }
.au-admin-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--au-grad); box-shadow: 0 10px 22px -12px rgba(79, 70, 229, .9); }
.au-admin-ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.au-admin-card h2 { margin: 2px 0 6px; font-size: 17px; font-weight: 600; }
.au-admin-card p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--au-ink-2); }

/* the sliding glass panel */
.au-overlay { position: absolute; top: 0; left: 50%; width: 50%; height: 100%; overflow: hidden; z-index: 5; transition: transform 820ms var(--au-ease); }
.au[data-mode="signup"] .au-overlay { transform: translateX(-100%); }
.au-overlay-track {
  position: relative; left: -100%; width: 200%; height: 100%; display: flex; transform: translateX(0);   /* right half of the track sits in view */
  transition: transform 820ms var(--au-ease);
  background-color: #0E0E12;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .08 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>"),
    repeating-linear-gradient(98deg, rgba(255,255,255,.06) 0 1.5px, rgba(255,255,255,0) 1.5px 7px, rgba(0,0,0,.22) 7px 9px, rgba(0,0,0,0) 9px 17px),
    radial-gradient(40% 50% at 20% 15%, rgba(var(--sg1), .75), rgba(var(--sg1), 0) 70%),
    radial-gradient(45% 55% at 80% 70%, rgba(var(--sg2), .6), rgba(var(--sg2), 0) 72%),
    radial-gradient(35% 40% at 55% 100%, rgba(var(--sg3), .35), rgba(var(--sg3), 0) 70%),
    linear-gradient(135deg, #1E1B4B, #0E0E12);
}
.au[data-mode="signup"] .au-overlay-track { transform: translateX(50%); }   /* left half slides into view as the panel moves */
.au-overlay-side {
  width: 50%; height: 100%; padding: 56px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; color: #fff;
  transition: transform 820ms var(--au-ease), opacity 500ms ease;
}
.au-overlay-side h2 { margin: 0 0 10px; font-size: 34px; font-weight: 600; letter-spacing: -.025em; line-height: 1.1; }
.au-overlay-side p { margin: 0 0 26px; max-width: 30ch; font-size: 16px; line-height: 1.5; color: rgba(255, 255, 255, .78); }
.au-ov-left { transform: translateX(-18%); opacity: 0; }
.au[data-mode="signup"] .au-ov-left { transform: none; opacity: 1; }
.au[data-mode="signup"] .au-ov-right { transform: translateX(18%); opacity: 0; }
.au-btn-glass {
  color: #fff; background: linear-gradient(165deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .06));
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 0 0 1px rgba(255, 255, 255, .18), 0 14px 30px -16px rgba(0, 0, 0, .8);
  min-width: 150px;
}
.au-btn-glass:hover { background: linear-gradient(165deg, rgba(255, 255, 255, .30), rgba(255, 255, 255, .10)); }
.au-btn-glass:focus-visible { outline-color: #fff; }

.au-foot { margin: 0; font-size: 12.5px; color: rgba(255, 255, 255, .5); letter-spacing: .02em; }

/* opened straight from #signup: no slide on load */
html.au-start-signup .au, html.au-start-signup .au * { transition: none !important; }

/* phones and narrow windows: tab bar + sideways slide */
@media (max-width: 880px) {
  body.au-body { padding: 16px; justify-content: flex-start; padding-top: max(24px, env(safe-area-inset-top)); }
  .au { height: auto; min-height: 0; display: grid; grid-template-rows: auto 1fr; border-radius: 26px; }
  .au-overlay { display: none; }
  .au-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin: 18px 18px 0; padding: 4px; border-radius: 999px; background: var(--au-field); box-shadow: inset 0 0 0 1px var(--au-border); isolation: isolate; }
  .au-tabs button { position: relative; z-index: 1; height: 42px; border: 0; background: transparent; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--au-ink-3); border-radius: 999px; cursor: pointer; transition: color 300ms ease; }
  .au-tabs button[aria-selected="true"] { color: #fff; }
  .au-tabs-pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--au-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 18px -10px rgba(79, 70, 229, .9); transition: transform 560ms var(--au-ease); }
  .au[data-mode="signup"] .au-tabs-pill { transform: translateX(100%); }
  .au-panel { position: relative; grid-row: 2; grid-column: 1; left: auto; width: 100%; height: auto; padding: 26px 22px 28px; justify-content: flex-start; }
  .au-signin { transform: none; }
  .au-signup { transform: translateX(40px); }
  .au[data-mode="signup"] .au-signin { transform: translateX(-40px); }
  .au-logo { height: 32px; margin-bottom: 20px; }
  .au h1 { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  .au *, .au { transition-duration: 1ms !important; }
}
