/* ============================================
   RESTROY Auth — Premium SaaS Design System
   Primary #E52323 · Dark #111827 · Muted #64748B
   Surface #F8FAFC / white
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --r-red: #E52323;
  --r-red-deep: #B91212;
  --r-red-soft: rgba(229, 35, 35, .12);
  --r-ink: #111827;
  --r-muted: #64748B;
  --r-line: rgba(15, 23, 42, .08);
  --r-line-strong: rgba(15, 23, 42, .14);
  --r-surface: #F8FAFC;
  --r-white: #FFFFFF;
  --r-ok: #059669;
  --r-warn: #D97706;
  --r-err: #DC2626;
  --r-blue: #2563EB;
  --r-radius-card: 24px;
  --r-radius-field: 14px;
  --r-shadow-card: 0 1px 2px rgba(15, 23, 42, .04), 0 24px 64px -24px rgba(15, 23, 42, .18), 0 8px 24px -12px rgba(15, 23, 42, .08);
  --r-ease: cubic-bezier(.22, 1, .36, 1);
  --r-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html { -webkit-text-size-adjust: 100%; }

/* ─── Site top nav (login / register) — matches home ─── */
.auth-topnav {
  position: sticky;
  top: 0;
  z-index: 76;
  padding: 16px 16px 0;
  background: transparent;
  pointer-events: none;
}
.auth-topnav > * { pointer-events: auto; }
.auth-topnav__shell {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 76;
}
.auth-topnav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 16px 0 18px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.12);
}
.auth-topnav__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.auth-topnav__logo img {
  height: 36px;
  width: auto;
  display: block;
}
.auth-topnav__links {
  display: none;
  align-items: center;
  gap: 2px;
}
.auth-topnav__links > a,
.auth-topnav__link-btn {
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .2s ease, background .2s ease;
}
.auth-topnav__links > a:hover,
.auth-topnav__link-btn:hover {
  color: var(--r-red);
  background: rgba(229, 35, 35, 0.06);
}
.auth-topnav__dropdown { position: relative; }
.auth-topnav__dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  z-index: 60;
}
.auth-topnav__dropdown:hover .auth-topnav__dropdown-panel,
.auth-topnav__dropdown:focus-within .auth-topnav__dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.auth-topnav__dropdown-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.auth-topnav__dropdown-panel a:hover {
  background: rgba(229, 35, 35, 0.06);
  color: var(--r-red);
}
.auth-topnav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-topnav__login {
  display: none;
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 10px;
}
.auth-topnav__login:hover { color: var(--r-red); }
.auth-topnav__login.is-active { color: var(--r-red); }
.auth-topnav__cta {
  display: none;
  background: #DC2626;
  color: #fff !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 20px -8px rgba(220, 38, 38, 0.55);
  transition: transform .2s ease, background .2s ease;
}
.auth-topnav__cta:hover {
  background: #B91C1C;
  transform: translateY(-1px);
}
.auth-topnav__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
  color: #334155;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.auth-topnav__toggle svg { transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.auth-topnav__toggle:hover { background: rgba(15, 23, 42, 0.08); color: var(--r-red); }
.auth-topnav__toggle[aria-expanded="true"] {
  background: rgba(220, 38, 38, 0.08);
  color: #DC2626;
}
.auth-topnav__toggle[aria-expanded="true"] svg { transform: rotate(90deg); }

/* Right-side drawer */
.auth-topnav__drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 90vw);
  height: 100dvh;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  z-index: 80;
  transform: translateX(105%);
  transition: transform .38s cubic-bezier(.22, 1, .36, 1);
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.2);
  border-left: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: hidden;
}
.auth-topnav__drawer[hidden] { display: none !important; }
.auth-topnav__drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}
.auth-topnav__drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 2;
}
.auth-topnav__drawer-logo { height: 32px; width: auto; display: block; }
.auth-topnav__drawer-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: rgba(220, 38, 38, 0.08);
  color: #DC2626;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6) rotate(-90deg);
  transition: opacity .3s ease, transform .4s cubic-bezier(.34, 1.56, .64, 1), background .2s ease;
}
.auth-topnav__drawer.is-open .auth-topnav__drawer-close {
  opacity: 1;
  transform: none;
}
.auth-topnav__drawer-close svg {
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}
.auth-topnav__drawer-close:hover { background: rgba(220, 38, 38, 0.14); }
.auth-topnav__drawer-close:hover svg { transform: rotate(90deg); }
.auth-topnav__drawer-close:active { transform: scale(0.9); }
.auth-topnav__drawer.is-open .auth-topnav__drawer-close:active { transform: scale(0.9); }
.auth-topnav__drawer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px;
  flex: 1;
}
.auth-topnav__drawer-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #334155;
  font-size: 15px;
  font-weight: 500;
  padding: 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid transparent;
  opacity: 0;
  transform: translateX(28px);
  transition:
    opacity .35s ease calc(var(--ai, 0) * 0.045s + 0.1s),
    transform .4s cubic-bezier(.22, 1, .36, 1) calc(var(--ai, 0) * 0.045s + 0.1s),
    background .2s ease,
    color .2s ease,
    border-color .2s ease;
}
.auth-topnav__drawer.is-open .auth-topnav__drawer-links a {
  opacity: 1;
  transform: translateX(0);
}
.auth-topnav__drawer-links a:nth-child(1) { --ai: 0; }
.auth-topnav__drawer-links a:nth-child(2) { --ai: 1; }
.auth-topnav__drawer-links a:nth-child(3) { --ai: 2; }
.auth-topnav__drawer-links a:nth-child(4) { --ai: 3; }
.auth-topnav__drawer-links a:nth-child(5) { --ai: 4; }
.auth-topnav__drawer-links a:nth-child(6) { --ai: 5; }
.auth-topnav__drawer-links a:nth-child(7) { --ai: 6; }
.auth-topnav__drawer-links a:hover { background: rgba(220, 38, 38, 0.07); color: #DC2626; border-color: rgba(220, 38, 38, 0.12); }
.auth-topnav__mobile-cta {
  margin-top: 8px;
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%) !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow: 0 12px 28px -12px rgba(220, 38, 38, 0.7);
}
.auth-topnav__mobile-cta:hover { filter: brightness(1.05); color: #fff !important; }
.auth-topnav__mobile-login {
  margin-top: 4px;
  border: 1px solid var(--r-line-strong);
}
.auth-topnav__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 75;
  opacity: 0;
  transition: opacity .3s ease;
}
.auth-topnav__backdrop[hidden] { display: none !important; }
.auth-topnav__backdrop.is-open { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .auth-topnav__drawer,
  .auth-topnav__backdrop,
  .auth-topnav__drawer-close,
  .auth-topnav__drawer-links a {
    transition: none !important;
  }
}

@media (min-width: 900px) {
  .auth-topnav__links { display: flex; }
  .auth-topnav__login,
  .auth-topnav__cta { display: inline-flex; align-items: center; }
  .auth-topnav__toggle { display: none; }
  .auth-topnav__drawer,
  .auth-topnav__backdrop { display: none !important; }
}

body.auth-page {
  font-family: var(--r-font);
  color: var(--r-ink);
  background: var(--r-surface);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Atmosphere ─── */
.auth-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(229, 35, 35, .07), transparent 55%),
    radial-gradient(900px 500px at 90% 110%, rgba(37, 99, 235, .07), transparent 50%),
    linear-gradient(180deg, #FFFFFF 0%, var(--r-surface) 100%);
}

.auth-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
  opacity: .55;
}
.auth-glow--red {
  width: min(520px, 55vw);
  height: min(520px, 55vw);
  background: radial-gradient(circle, rgba(229, 35, 35, .28), transparent 68%);
  top: -12%;
  left: -8%;
  animation: glowDriftA 18s ease-in-out infinite;
}
.auth-glow--blue {
  width: min(480px, 50vw);
  height: min(480px, 50vw);
  background: radial-gradient(circle, rgba(37, 99, 235, .2), transparent 70%);
  bottom: -14%;
  right: -6%;
  animation: glowDriftB 22s ease-in-out infinite;
}
.auth-glow--soft {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(229, 35, 35, .12), transparent 70%);
  top: 42%;
  left: 38%;
  animation: glowDriftC 26s ease-in-out infinite;
}

@keyframes glowDriftA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(36px, 28px) scale(1.06); }
}
@keyframes glowDriftB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, -24px) scale(1.05); }
}
@keyframes glowDriftC {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -30px); }
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}

.auth-streak {
  position: absolute;
  width: 180px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(229, 35, 35, .45), transparent);
  opacity: .5;
  animation: streakSlide 12s linear infinite;
}
.auth-streak--1 { top: 22%; left: -10%; animation-duration: 14s; }
.auth-streak--2 {
  top: 68%;
  left: 40%;
  width: 240px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, .4), transparent);
  animation-duration: 18s;
  animation-delay: -6s;
}
@keyframes streakSlide {
  0% { transform: translateX(-20vw); opacity: 0; }
  15% { opacity: .55; }
  85% { opacity: .35; }
  100% { transform: translateX(120vw); opacity: 0; }
}

.auth-particles { position: absolute; inset: 0; overflow: hidden; }
.auth-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(229, 35, 35, .35);
  animation: particleRise linear infinite;
  opacity: 0;
}
.auth-particle.is-blue { background: rgba(37, 99, 235, .35); }
@keyframes particleRise {
  0% { transform: translateY(10vh) scale(.6); opacity: 0; }
  12% { opacity: .8; }
  88% { opacity: .55; }
  100% { transform: translateY(-8vh) scale(1); opacity: 0; }
}

/* ─── Shell ─── */
.auth-shell {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 64px);
  min-height: calc(100dvh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
}

/* ─── Left brand panel ─── */
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.75rem, 3vw, 2.75rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .72) 0%, rgba(248, 250, 252, .55) 45%, rgba(255, 255, 255, .4) 100%);
  border-right: 1px solid rgba(15, 23, 42, .06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-brand::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(229, 35, 35, .28), rgba(37, 99, 235, .18), transparent);
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--r-ink);
  width: fit-content;
  animation: logoEnter .7s var(--r-ease) both;
}
.auth-logo__mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
  background: linear-gradient(145deg, #FF3B3B 0%, var(--r-red) 45%, var(--r-red-deep) 100%);
  box-shadow:
    0 10px 24px -10px rgba(229, 35, 35, .65),
    inset 0 1px 0 rgba(255, 255, 255, .28);
}
.auth-logo__text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.04em;
}
.auth-logo__text em {
  font-style: normal;
  color: var(--r-red);
}
.auth-logo:hover .auth-logo__mark {
  box-shadow:
    0 14px 28px -10px rgba(229, 35, 35, .7),
    inset 0 1px 0 rgba(255, 255, 255, .35);
}
@keyframes logoEnter {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-brand__copy {
  max-width: 34rem;
  margin-top: clamp(0.5rem, 2vh, 1.5rem);
  animation: riseIn .75s var(--r-ease) .08s both;
}
.auth-brand__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--r-red);
  margin-bottom: 14px;
}
.auth-brand__eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--r-red), transparent);
}
.auth-brand__copy h1 {
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -.04em;
  font-weight: 800;
  color: var(--r-ink);
  margin-bottom: 14px;
}
.auth-brand__copy h1 span {
  background: linear-gradient(120deg, var(--r-red), #FF5A5A 55%, var(--r-red-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-brand__copy p {
  font-size: clamp(.95rem, 1.2vw, 1.05rem);
  line-height: 1.65;
  color: var(--r-muted);
  max-width: 32rem;
}

/* Widgets */
.auth-widgets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 560px;
  animation: riseIn .8s var(--r-ease) .16s both;
}
.auth-widget {
  position: relative;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(15, 23, 42, .07);
  border-radius: 18px;
  padding: 16px 16px 14px;
  box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  transition: transform .35s var(--r-ease), box-shadow .35s var(--r-ease);
  animation: widgetFloat 7s ease-in-out infinite;
}
.auth-widget:nth-child(2) { animation-delay: -1.4s; animation-duration: 8s; }
.auth-widget:nth-child(3) { animation-delay: -2.8s; animation-duration: 9s; }
.auth-widget:nth-child(4) { animation-delay: -4.1s; animation-duration: 7.5s; }
.auth-widget:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .32);
}
.auth-widget::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(229, 35, 35, .35), transparent);
}
.auth-widget__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.auth-widget__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--r-muted);
  letter-spacing: .02em;
}
.auth-widget__icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(229, 35, 35, .08);
  color: var(--r-red);
  flex-shrink: 0;
}
.auth-widget__icon svg { width: 15px; height: 15px; }
.auth-widget__icon.is-green { background: rgba(5, 150, 105, .1); color: var(--r-ok); }
.auth-widget__icon.is-blue { background: rgba(37, 99, 235, .1); color: var(--r-blue); }
.auth-widget__icon.is-amber { background: rgba(217, 119, 6, .12); color: var(--r-warn); }
.auth-widget__value {
  font-size: clamp(1.25rem, 1.6vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--r-ink);
  line-height: 1.1;
  margin-bottom: 6px;
}
.auth-widget__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--r-ok);
}
.auth-widget__meta.is-warn { color: var(--r-warn); }
.auth-widget__meta.is-neutral { color: var(--r-muted); }
.auth-widget__meta .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulseDot 1.8s ease-out infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, .45); }
  70% { box-shadow: 0 0 0 8px rgba(5, 150, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}
@keyframes widgetFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-trust {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--r-muted);
  animation: riseIn .8s var(--r-ease) .28s both;
}
.auth-trust__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--r-ok);
}
.auth-trust__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(5, 150, 105, .45);
  animation: ringPulse 2s ease-out infinite;
}
@keyframes ringPulse {
  0% { transform: scale(.7); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ─── Right form panel ─── */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  min-width: 0;
}
.auth-panel__inner {
  width: 100%;
  max-width: 460px;
  max-height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 2px 12px;
}

.auth-mobile-brand {
  display: none;
  justify-content: center;
  margin-bottom: 1.25rem;
}

/* Card */
.auth-card {
  position: relative;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(15, 23, 42, .07);
  border-radius: var(--r-radius-card);
  padding: clamp(1.5rem, 3vw, 2.15rem) clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--r-shadow-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  animation: cardIn .7s var(--r-ease) both;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(229, 35, 35, .45), rgba(37, 99, 235, .25), transparent);
}
.auth-card::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(229, 35, 35, .08), transparent 70%);
  pointer-events: none;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card__header {
  position: relative;
  z-index: 1;
  margin-bottom: 1.5rem;
  animation: riseIn .6s var(--r-ease) .1s both;
}
.auth-card__header h2 {
  font-size: clamp(1.5rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -.035em;
  color: var(--r-ink);
  margin-bottom: 8px;
  line-height: 1.2;
}
.auth-card__header p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--r-muted);
}
.auth-card__header p strong {
  color: var(--r-ink);
  font-weight: 600;
}

/* Accent line under header */
.auth-accent {
  display: block;
  width: 48px;
  height: 3px;
  border-radius: 999px;
  margin-top: 14px;
  background: linear-gradient(90deg, var(--r-red), rgba(229, 35, 35, .15));
  transform-origin: left center;
  animation: accentGrow .7s var(--r-ease) .25s both;
}
@keyframes accentGrow {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

/* Server error banner */
.auth-error {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 1.1rem;
  animation: errIn .35s var(--r-ease) both;
}
.auth-error svg { flex-shrink: 0; margin-top: 1px; color: var(--r-err); }
@keyframes errIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Fields ─── */
.auth-form { position: relative; z-index: 1; }

.auth-field {
  position: relative;
  margin-bottom: 14px;
  animation: fieldIn .55s var(--r-ease) both;
}
.auth-field:nth-child(1) { animation-delay: .18s; }
.auth-field:nth-child(2) { animation-delay: .24s; }
.auth-field:nth-child(3) { animation-delay: .3s; }
.auth-field:nth-child(4) { animation-delay: .36s; }
.auth-field:nth-child(5) { animation-delay: .42s; }
.auth-field:nth-child(6) { animation-delay: .48s; }
@keyframes fieldIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-field input {
  width: 100%;
  height: 54px;
  border-radius: var(--r-radius-field);
  border: 1.5px solid #E2E8F0;
  background: #fff;
  color: var(--r-ink);
  font: 500 15px/1 var(--r-font);
  padding: 20px 46px 8px 48px;
  outline: none;
  caret-color: var(--r-red);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .02);
}
.auth-field input::placeholder { color: transparent; }
.auth-field input:hover:not(:focus) { border-color: #CBD5E1; }
.auth-field input:focus {
  border-color: var(--r-red);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(229, 35, 35, .12);
}
.auth-field input.is-error {
  border-color: var(--r-err);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .1);
}
.auth-field input.is-ok {
  border-color: rgba(5, 150, 105, .55);
}
.auth-field input:disabled { background: #F8FAFC; cursor: not-allowed; }

.auth-field__label {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14.5px;
  color: #94A3B8;
  pointer-events: none;
  transition: all .18s ease;
  z-index: 1;
  max-width: calc(100% - 100px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-field input:focus ~ .auth-field__label,
.auth-field input:not(:placeholder-shown) ~ .auth-field__label,
.auth-field input.is-filled ~ .auth-field__label,
.auth-field input:autofill ~ .auth-field__label {
  top: 11px;
  transform: none;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--r-red);
}
.auth-field input.is-error ~ .auth-field__label { color: var(--r-err); }

/* ─── Legacy float fields (signup / staff login) ─── */
.input-group {
  position: relative;
  margin-bottom: 14px;
}
.input-group input {
  width: 100%;
  height: 54px;
  border-radius: var(--r-radius-field);
  border: 1.5px solid #E2E8F0;
  background: #fff;
  color: var(--r-ink);
  font: 500 15px/1 var(--r-font);
  padding: 20px 46px 8px 48px;
  outline: none;
  caret-color: var(--r-red);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .02);
}
.input-group input::placeholder { color: transparent; opacity: 0; }
.input-group input:hover:not(:focus) { border-color: #CBD5E1; }
.input-group input:focus {
  border-color: var(--r-red);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(229, 35, 35, .12);
}
.input-group .input-icon,
.input-group .icon {
  position: absolute;
  left: 16px;
  top: 27px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94A3B8;
  pointer-events: none;
  transition: color .2s ease, transform .2s ease;
  z-index: 2;
}
.input-group input:focus ~ .input-icon,
.input-group input:focus ~ .icon {
  color: var(--r-red);
  transform: translateY(-50%) scale(1.06);
}
.float-label,
.input-group .label {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14.5px;
  color: #94A3B8;
  pointer-events: none;
  transition: top .18s ease, transform .18s ease, font-size .18s ease, color .18s ease, letter-spacing .18s ease;
  z-index: 1;
  max-width: calc(100% - 100px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.input-group input:focus ~ .float-label,
.input-group input:not(:placeholder-shown) ~ .float-label,
.input-group input.is-filled ~ .float-label,
.input-group input:autofill ~ .float-label,
.input-group input:focus ~ .label,
.input-group input:not(:placeholder-shown) ~ .label,
.input-group input.is-filled ~ .label {
  top: 11px;
  transform: none;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--r-red);
}
.input-line {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--r-red), rgba(229, 35, 35, .2));
  opacity: 0;
  transform: scaleX(.4);
  transform-origin: center;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.input-group input:focus ~ .input-line {
  opacity: 1;
  transform: scaleX(1);
}
.input-group .pw-toggle,
.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  cursor: pointer;
  transition: color .2s ease;
  z-index: 3;
  background: none;
  border: none;
  padding: 4px;
  line-height: 0;
}
.input-group .pw-toggle:hover,
.pw-toggle:hover { color: var(--r-red); }
.input-group .pw-toggle svg,
.pw-toggle svg { width: 18px; height: 18px; display: block; }
.field-msg {
  min-height: 0;
  margin-top: 4px;
  font-size: 12px;
  color: var(--r-muted);
}
.field-msg.success { color: var(--r-ok); }
.field-msg.error { color: var(--r-err); }

.auth-field__icon {
  position: absolute;
  left: 16px;
  top: 27px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94A3B8;
  pointer-events: none;
  transition: color .2s ease, transform .2s ease;
  z-index: 2;
}
.auth-field input:focus ~ .auth-field__icon {
  color: var(--r-red);
  transform: translateY(-50%) scale(1.06);
}

.auth-field__glow {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--r-red), rgba(229, 35, 35, .2));
  opacity: 0;
  transform: scaleX(.4);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.auth-field input:focus ~ .auth-field__glow {
  opacity: 1;
  transform: scaleX(1);
}

.auth-field__msg {
  display: none;
  margin-top: 6px;
  padding-left: 4px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--r-err);
  animation: msgIn .28s var(--r-ease) both;
}
.auth-field__msg.is-visible { display: block; }
.auth-field__msg.is-ok { color: var(--r-ok); }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Password toggle */
.auth-pw-toggle {
  position: absolute;
  right: 10px;
  top: 27px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #94A3B8;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 3;
  transition: color .18s, background .18s, transform .18s;
}
.auth-pw-toggle:hover { color: var(--r-red); background: rgba(229, 35, 35, .07); }
.auth-pw-toggle:active { transform: translateY(-50%) scale(.94); }
.auth-pw-toggle:focus-visible {
  outline: 2px solid rgba(229, 35, 35, .5);
  outline-offset: 1px;
}
.auth-pw-toggle svg { width: 18px; height: 18px; }
.auth-pw-toggle .eye-hide { display: none; }
.auth-pw-toggle.is-on .eye-show { display: none; }
.auth-pw-toggle.is-on .eye-hide { display: block; }

/* Name row */
.auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.auth-row .auth-field { margin-bottom: 14px; }

/* Meta row: remember + forgot */
.auth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 18px;
  flex-wrap: wrap;
  animation: fieldIn .5s var(--r-ease) .4s both;
}

.auth-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13.5px;
  color: #475569;
  line-height: 1.4;
}
.auth-check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.auth-check__box {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1.5px solid #CBD5E1;
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all .18s ease;
  position: relative;
}
.auth-check__box svg {
  width: 12px;
  height: 12px;
  color: #fff;
  opacity: 0;
  transform: scale(.6);
  transition: all .18s var(--r-ease);
}
.auth-check input:checked + .auth-check__box {
  background: linear-gradient(145deg, #FF3B3B, var(--r-red));
  border-color: var(--r-red);
  box-shadow: 0 4px 10px -4px rgba(229, 35, 35, .55);
}
.auth-check input:checked + .auth-check__box svg {
  opacity: 1;
  transform: scale(1);
}
.auth-check input:focus-visible + .auth-check__box {
  outline: 2px solid rgba(229, 35, 35, .5);
  outline-offset: 2px;
}
.auth-check a {
  color: var(--r-red);
  font-weight: 600;
  text-decoration: none;
}
.auth-check a:hover { text-decoration: underline; }

.auth-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--r-red);
  text-decoration: none;
  transition: color .18s;
}
.auth-link:hover { color: var(--r-red-deep); text-decoration: underline; }
.auth-link:focus-visible {
  outline: 2px solid rgba(229, 35, 35, .45);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Primary button */
.auth-btn {
  position: relative;
  width: 100%;
  min-height: 50px;
  border: none;
  border-radius: 14px;
  padding: 0 20px;
  font: 700 15px/1 var(--r-font);
  letter-spacing: -.01em;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(145deg, #FF3B3B 0%, var(--r-red) 48%, var(--r-red-deep) 100%);
  box-shadow:
    0 10px 24px -12px rgba(229, 35, 35, .75),
    inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .2s var(--r-ease), box-shadow .2s ease, filter .2s ease;
  animation: fieldIn .55s var(--r-ease) .48s both;
}
.auth-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .55s ease;
}
.auth-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow:
    0 16px 32px -14px rgba(229, 35, 35, .8),
    inset 0 1px 0 rgba(255, 255, 255, .28);
}
.auth-btn:hover:not(:disabled)::before { transform: translateX(120%); }
.auth-btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.auth-btn:focus-visible {
  outline: 2px solid rgba(229, 35, 35, .55);
  outline-offset: 3px;
}
.auth-btn:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none !important;
  filter: none;
  box-shadow: none;
}
.auth-btn__label { position: relative; z-index: 1; }
.auth-btn__spin {
  position: relative;
  z-index: 1;
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  animation: spin .65s linear infinite;
}
.auth-btn.is-loading .auth-btn__label { display: none; }
.auth-btn.is-loading .auth-btn__spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 1.15rem 0;
  animation: fieldIn .5s var(--r-ease) .52s both;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #E2E8F0, transparent);
}
.auth-divider span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #94A3B8;
}

/* Switch footer under card */
.auth-switch {
  text-align: center;
  margin-top: 1.15rem;
  font-size: 14px;
  color: var(--r-muted);
  animation: fieldIn .5s var(--r-ease) .58s both;
}
.auth-switch a {
  color: var(--r-red);
  font-weight: 700;
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

.auth-footnote {
  text-align: center;
  margin-top: 0.85rem;
  font-size: 12.5px;
  color: #94A3B8;
}

/* Page enter transition for login ↔ register */
.auth-page-enter {
  animation: pageEnter .55s var(--r-ease) both;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Password strength */
.auth-strength {
  margin: -4px 0 14px;
  animation: fieldIn .45s var(--r-ease) .5s both;
}
.auth-strength[hidden] { display: none !important; }
.auth-strength__bar {
  height: 5px;
  border-radius: 999px;
  background: #E2E8F0;
  overflow: hidden;
  margin-bottom: 8px;
}
.auth-strength__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: transparent;
  transition: width .4s var(--r-ease), background .35s ease;
}
.auth-strength__fill.s1 { width: 25%; background: #DC2626; }
.auth-strength__fill.s2 { width: 50%; background: #F97316; }
.auth-strength__fill.s3 { width: 75%; background: #EAB308; }
.auth-strength__fill.s4 { width: 100%; background: linear-gradient(90deg, #10B981, #059669); }
.auth-strength__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--r-muted);
  margin-bottom: 8px;
}
.auth-strength__level { font-weight: 700; }
.auth-strength__reqs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.auth-req {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #94A3B8;
  transition: color .2s;
}
.auth-req.is-met { color: var(--r-ok); font-weight: 600; }
.auth-req__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #CBD5E1;
  transition: background .2s, transform .2s;
  flex-shrink: 0;
}
.auth-req.is-met .auth-req__dot {
  background: var(--r-ok);
  transform: scale(1.15);
}

/* Confirm match */
.auth-match {
  display: none;
  margin-top: 6px;
  padding-left: 4px;
  font-size: 12.5px;
  font-weight: 600;
  animation: msgIn .28s var(--r-ease) both;
}
.auth-match.is-visible { display: flex; align-items: center; gap: 6px; }
.auth-match.is-ok { color: var(--r-ok); }
.auth-match.is-no { color: var(--r-err); }

/* Toast */
.auth-toast {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 16px 40px -16px rgba(15, 23, 42, .35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateX(120%);
  transition: transform .4s var(--r-ease);
}
.auth-toast.is-show { transform: translateX(0); }
.auth-toast--error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.auth-toast--warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.auth-toast--success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.auth-toast__close {
  margin-left: auto;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: .55;
  font-size: 16px;
  line-height: 1;
  padding: 2px;
}
.auth-toast__close:hover { opacity: 1; }

/* ─── Responsive ─── */
@media (max-width: 1200px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr) minmax(400px, .9fr); }
  .auth-brand__copy h1 { font-size: clamp(1.75rem, 3vw, 2.4rem); }
}

@media (max-width: 1024px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand {
    display: none;
  }
  .auth-mobile-brand { display: flex; }
  .auth-panel {
    align-items: flex-start;
    padding-top: clamp(1.25rem, 4vh, 2rem);
  }
  .auth-panel__inner {
    max-width: 480px;
    margin: 0 auto;
  }
  .auth-atmosphere .auth-grid { opacity: .7; }
}

@media (max-width: 768px) {
  .auth-panel { padding: 1rem; }
  .auth-card { padding: 1.4rem 1.15rem; border-radius: 20px; }
  .auth-row { grid-template-columns: 1fr; gap: 0; }
  .auth-strength__reqs { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .auth-card__header h2 { font-size: 1.35rem; }
  .auth-field input { height: 52px; font-size: 16px; }
  .auth-meta { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  .auth-meta .auth-link { text-align: center; }
  .auth-toast {
    top: auto;
    bottom: 16px;
    right: 12px;
    left: 12px;
    max-width: none;
    transform: translateY(120%);
  }
  .auth-toast.is-show { transform: translateY(0); }
}

@media (max-width: 375px) {
  .auth-panel { padding: 0.75rem; }
  .auth-card { padding: 1.2rem 1rem; }
  .auth-logo__mark { width: 40px; height: 40px; border-radius: 12px; }
  .auth-logo__text { font-size: 18px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .auth-glow,
  .auth-streak,
  .auth-particle,
  .auth-widget,
  .auth-trust__dot::after {
    animation: none !important;
  }
  .auth-widget:hover { transform: none; }
}
