:root {
  --auth-bg: #07111f;
  --auth-text: #edf4ff;
  --auth-muted: #9db0c9;
  --auth-primary: #67d8ff;
  --auth-accent: #8b7dff;
  --auth-line: rgba(255,255,255,0.08);
  --auth-shadow: 0 24px 80px rgba(0,0,0,0.32);
}

* { box-sizing: border-box; }
body.auth-body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--auth-text);
  background:
    radial-gradient(circle at 15% 10%, rgba(103,216,255,.14), transparent 22%),
    radial-gradient(circle at 90% 0%, rgba(139,125,255,.18), transparent 24%),
    linear-gradient(180deg, #050c16 0%, #07111f 50%, #081728 100%);
  position: relative;
}
body.auth-body::before,
body.auth-body::after {
  content: '';
  position: fixed;
  border-radius: 999px;
  filter: blur(24px);
  pointer-events: none;
  opacity: .42;
}
body.auth-body::before {
  width: 320px; height: 320px; left: -80px; top: 90px;
  background: rgba(103,216,255,.18);
}
body.auth-body::after {
  width: 360px; height: 360px; right: -120px; bottom: 80px;
  background: rgba(139,125,255,.16);
}

a { color: inherit; text-decoration: none; }
.auth-page-reimagined { min-height: 100vh; padding: 24px; }
.auth-topbar {
  max-width: 1320px; margin: 0 auto 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.auth-home { display: flex; align-items: center; gap: 14px; }
.auth-home-mark {
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(103,216,255,.24), rgba(139,125,255,.24));
  border: 1px solid rgba(255,255,255,.08); box-shadow: var(--auth-shadow);
}
.auth-home-copy { display: flex; flex-direction: column; gap: 4px; }
.auth-home-copy strong { font-family: 'Sora', sans-serif; }
.auth-home-copy span, .auth-topbar-link { color: var(--auth-muted); }
.auth-topbar-actions { display: flex; align-items: center; gap: 12px; }
.auth-topbar-link {
  min-height: 42px; padding: 0 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--auth-line); background: rgba(255,255,255,.02);
}

.auth-reimagined-layout {
  max-width: 1320px; margin: 0 auto;
  display: grid; grid-template-columns: 1.08fr .92fr; gap: 24px; align-items: stretch;
}
.auth-reimagined-layout.auth-layout-ios { grid-template-columns: .42fr .58fr; gap: 20px; }
.auth-reimagined-layout.register-layout { grid-template-columns: .98fr 1.02fr; }
.auth-reimagined-layout.register-layout.auth-layout-ios { grid-template-columns: .38fr .62fr; }

.glass-panel-dark, .glass-panel-light {
  border-radius: 32px; border: 1px solid rgba(255,255,255,.08); box-shadow: var(--auth-shadow);
}
.glass-panel-dark {
  background: linear-gradient(180deg, rgba(10, 20, 36, .92), rgba(12, 23, 40, .8));
  padding: 34px; position: relative; overflow: hidden;
}
.glass-panel-dark::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(103,216,255,.08), transparent 34%, transparent 66%, rgba(139,125,255,.08));
  pointer-events: none;
}
.glass-panel-light {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,251,255,.94));
  color: #122033; padding: 32px; position: relative; overflow: hidden;
}
.glass-panel-light::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(103,216,255,.05), transparent 28%);
  pointer-events: none;
}
.glass-panel-dark > *, .glass-panel-light > * { position: relative; z-index: 1; }

.auth-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.08);
  color: var(--auth-primary); background: rgba(255,255,255,.03); font-weight: 700; font-size: .88rem;
}
.auth-badge-dot {
  width: 8px; height: 8px; border-radius: 999px; background: #53ffbf; box-shadow: 0 0 0 6px rgba(83,255,191,.12);
}
.auth-reimagined-story h1, .auth-form-header h2 {
  font-family: 'Sora', sans-serif; margin: 18px 0 0; line-height: 1.08;
}
.auth-reimagined-story h1 { font-size: clamp(2.7rem, 4vw, 4.5rem); max-width: 12ch; }
.auth-story-minimal h1 { max-width: 10ch; font-size: clamp(2.4rem, 3.6vw, 4rem); }
.auth-showcase-text {
  margin: 20px 0 0; color: #b4c2d8; line-height: 1.85; max-width: 44ch;
}
.auth-story-points { display: grid; gap: 12px; margin-top: 26px; }
.auth-story-points article {
  display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: start;
  padding: 16px 18px; border-radius: 22px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.05);
}
.auth-story-points i {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(103,216,255,.18), rgba(139,125,255,.16)); color: var(--auth-primary);
}
.auth-story-points strong { display: block; font-size: 1rem; }
.auth-story-points span { display: block; margin-top: 6px; color: #9fb1c9; line-height: 1.65; }

.reimagined-steps { display: grid; gap: 14px; margin-top: 28px; }
.reimagined-steps article {
  display: grid; grid-template-columns: 56px 1fr; align-items: start;
  padding: 20px; border-radius: 24px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06);
}
.reimagined-steps article span {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  color: var(--auth-primary); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  background: linear-gradient(135deg, rgba(103,216,255,.18), rgba(139,125,255,.18));
}
.reimagined-steps strong { display: block; margin: 10px 0; font-size: 1.05rem; }
.reimagined-steps p { margin: 0; color: var(--auth-muted); line-height: 1.72; }

.login-status-ribbon {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px;
}
.login-status-ribbon article {
  padding: 16px 18px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.028));
  border: 1px solid rgba(255,255,255,.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.login-status-ribbon span {
  color: var(--auth-primary); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}
.login-status-ribbon strong { display: block; margin-top: 8px; font-size: .98rem; }
.compact-ribbon { grid-template-columns: repeat(2, 1fr); }
.register-ribbon { margin-top: 22px; }

.auth-form-topline {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px;
}
.auth-form-kicker {
  display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 700;
  color: #267ab8; padding: 8px 14px; border-radius: 999px; background: rgba(103,216,255,.12);
}
.auth-inline-link { color: #267ab8; font-weight: 700; }
.auth-inline-muted { color: #7b8ca4; font-size: .9rem; font-weight: 600; }
.auth-form-elevated {
  box-shadow: 0 28px 90px rgba(6, 20, 38, .18), 0 8px 20px rgba(103,216,255,.08);
  transform: translateY(-4px);
}
.auth-form-ios { backdrop-filter: blur(18px); }
.auth-header-tight h2 { letter-spacing: -.03em; }
.auth-header-tight p, .auth-form-header p { max-width: 40ch; margin: 12px 0 0; color: #64748b; line-height: 1.8; }

.auth-panel-mini {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 20px 0 18px;
}
.auth-panel-mini article {
  padding: 14px 16px; border-radius: 18px; background: linear-gradient(180deg, rgba(248,251,255,.95), rgba(239,246,252,.88));
  border: 1px solid rgba(15,23,42,.06);
}
.auth-panel-mini span {
  color: #2c6b99; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
}
.auth-panel-mini strong { display: block; margin-top: 8px; color: #13253a; font-size: .94rem; }
.register-mini { margin-top: 18px; }

.auth-tabs {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 22px 0 18px;
}
.auth-tabs button {
  min-height: 46px; border-radius: 16px; border: 1px solid rgba(15,23,42,.08); background: #f6f9fd; color: #4a5b72; font-weight: 700;
  transition: all .2s ease;
}
.auth-tabs button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15,23,42,.06); }
.auth-tabs button.active {
  color: #0e2035; background: linear-gradient(180deg, #e8f8ff, #dff4ff); border-color: rgba(38,122,184,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.auth-message {
  display: none; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 16px; margin-bottom: 16px;
}
.auth-message.show { display: flex; }
.auth-message.error { background: #fff1f2; color: #b91c1c; }
.auth-message.success { background: #ecfdf5; color: #15803d; }

.auth-form { display: grid; gap: 18px; }
.auth-form-section {
  display: grid; gap: 14px; padding: 18px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(245,249,255,.96), rgba(239,246,252,.92));
  border: 1px solid rgba(15,23,42,.06);
}
.auth-section-label {
  font-size: .82rem; font-weight: 800; color: #2c6b99; text-transform: uppercase; letter-spacing: .08em;
}
.auth-form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-group { display: grid; gap: 8px; }
.form-group label { font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: 8px; }
.input-wrapper { position: relative; }
.form-input {
  width: 100%; min-height: 52px; border-radius: 16px; border: 1px solid rgba(15,23,42,.1); background: linear-gradient(180deg, #fbfdff, #f3f8fd);
  padding: 0 16px; font-size: 1rem; color: #0f172a; outline: none; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.form-input:hover { border-color: rgba(38,122,184,.18); }
.form-input:focus { border-color: rgba(38,122,184,.34); box-shadow: 0 0 0 4px rgba(103,216,255,.12); }
.form-input.valid { border-color: rgba(22,163,74,.35); }
.form-input.invalid { border-color: rgba(239,68,68,.35); }
.auth-password-toggle {
  position: absolute; top: 50%; right: 14px; transform: translateY(-50%);
  border: none; background: transparent; color: #64748b; cursor: pointer;
}
.auth-options, .auth-terms { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth-terms-soft {
  padding: 14px 16px; border-radius: 18px; background: rgba(246,249,253,.88); border: 1px solid rgba(15,23,42,.06);
}
.auth-check { display: inline-flex; align-items: center; gap: 10px; color: #475569; }
.auth-check-multiline { align-items: flex-start; }
.auth-submit {
  min-height: 52px; border-radius: 18px; border: none; cursor: pointer; font-weight: 800; font-size: 1rem;
  color: #04111e; background: linear-gradient(135deg, #67d8ff, #8cf0ff);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 14px 34px rgba(103,216,255,.2);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 18px 40px rgba(103,216,255,.24); }
.auth-submit:disabled { opacity: .7; cursor: not-allowed; }
.sms-code-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.sms-send-btn { min-width: 140px; }
.auth-divider { position: relative; text-align: center; margin: 18px 0 6px; }
.auth-divider::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(15,23,42,.08);
}
.auth-divider span { position: relative; background: rgba(255,255,255,.95); padding: 0 12px; color: #64748b; }
.auth-link { text-align: center; color: #64748b; margin-top: 8px; }
.auth-link a { color: #267ab8; font-weight: 700; }
.auth-footnote { font-size: .92rem; line-height: 1.7; color: #7a8ca5; margin-top: 4px; }
.password-strength {
  height: 8px; border-radius: 999px; background: #e8eef6; overflow: hidden;
}
.strength-bar { height: 100%; border-radius: inherit; transition: width .2s ease; }
.strength-weak { background: #ef4444; }
.strength-medium { background: #f59e0b; }
.strength-strong { background: #22c55e; }
.strength-text, .validation-hint { color: #64748b; font-size: .88rem; }
.validation-hint.invalid { color: #dc2626; }
.validation-hint.valid { color: #16a34a; }

@media (max-width: 1080px) {
  .auth-reimagined-layout,
  .auth-reimagined-layout.auth-layout-ios,
  .auth-reimagined-layout.register-layout,
  .auth-reimagined-layout.register-layout.auth-layout-ios,
  .auth-form-row,
  .compact-ribbon,
  .auth-panel-mini,
  .login-status-ribbon {
    grid-template-columns: 1fr;
  }
  .auth-form-elevated { transform: none; }
}
@media (max-width: 640px) {
  .auth-page-reimagined { padding: 16px; }
  .auth-topbar { flex-direction: column; align-items: flex-start; }
  .glass-panel-dark, .glass-panel-light { padding: 22px; }
  .auth-reimagined-story h1 { max-width: none; font-size: 2.35rem; }
  .auth-form-topline { flex-direction: column; align-items: flex-start; }
  .sms-code-row { grid-template-columns: 1fr; }
}

.auth-unlock-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px 12px;
  padding: 14px 16px;
  margin: 4px 0 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(236,248,255,.95), rgba(230,243,252,.88));
  border: 1px solid rgba(38,122,184,.12);
}
.auth-unlock-dot {
  width: 10px; height: 10px; border-radius: 999px; background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34,197,94,.12);
  grid-row: span 2;
}
.auth-unlock-strip strong {
  display: block; color: #12253a; font-size: .95rem; letter-spacing: -.01em;
}
.auth-unlock-strip span:last-child {
  color: #6a7f98; font-size: .9rem; line-height: 1.55;
}
.auth-tabs-ios {
  padding: 4px; border-radius: 18px; background: rgba(241,246,251,.92); border: 1px solid rgba(15,23,42,.05);
}
.auth-form-stack {
  padding: 18px; border-radius: 22px; background: linear-gradient(180deg, rgba(248,251,255,.94), rgba(242,247,252,.9));
  border: 1px solid rgba(15,23,42,.06);
}
.auth-submit-primary {
  min-height: 54px;
  box-shadow: 0 18px 40px rgba(103,216,255,.22);
}
.auth-setup-strip { margin-top: 0; }

@media (max-width: 640px) {
  .auth-unlock-strip {
    grid-template-columns: 1fr;
  }
  .auth-unlock-dot {
    grid-row: auto;
  }
}

@keyframes authFloatIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes authGlowPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(103,216,255,.0);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(103,216,255,.08);
  }
}

@keyframes authShimmer {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.glass-panel-dark,
.glass-panel-light {
  animation: authFloatIn .55s cubic-bezier(.22,1,.36,1);
}

.auth-story-points article,
.login-status-ribbon article,
.auth-panel-mini article,
.auth-form-section,
.auth-form-stack,
.auth-unlock-strip {
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease, background .24s ease;
}

.auth-story-points article:hover,
.login-status-ribbon article:hover,
.auth-panel-mini article:hover,
.auth-form-section:hover,
.auth-form-stack:hover,
.auth-unlock-strip:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15,23,42,.08);
}

.auth-home-mark,
.auth-badge-dot {
  animation: authGlowPulse 2.8s ease-in-out infinite;
}

.auth-submit,
.auth-tabs button,
.auth-topbar-link,
.auth-inline-link {
  transition: transform .22s ease, box-shadow .22s ease, opacity .22s ease, background .22s ease, border-color .22s ease;
}

.auth-topbar-link:hover,
.auth-inline-link:hover {
  transform: translateY(-1px);
}

.auth-submit,
.auth-submit-primary {
  position: relative;
  overflow: hidden;
}

.auth-submit::after,
.auth-submit-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.38), transparent);
  transform: translateX(-120%);
  pointer-events: none;
}

.auth-submit:hover::after,
.auth-submit-primary:hover::after {
  animation: authShimmer .9s ease;
}

.form-input,
.auth-password-toggle {
  transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease, color .22s ease;
}

.auth-password-toggle:hover {
  color: #267ab8;
  transform: translateY(-50%) scale(1.06);
}

.auth-tabs button.active {
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .glass-panel-dark,
  .glass-panel-light,
  .auth-home-mark,
  .auth-badge-dot {
    animation: none !important;
  }

  .auth-story-points article,
  .login-status-ribbon article,
  .auth-panel-mini article,
  .auth-form-section,
  .auth-form-stack,
  .auth-unlock-strip,
  .auth-submit,
  .auth-tabs button,
  .form-input,
  .auth-password-toggle,
  .auth-topbar-link,
  .auth-inline-link {
    transition: none !important;
  }
}

.auth-message-floating {
  border: 1px solid rgba(15,23,42,.06);
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
  backdrop-filter: blur(12px);
}
.auth-form-elevated::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.28), transparent 28%, transparent 72%, rgba(103,216,255,.08));
  pointer-events: none;
  z-index: 0;
}
.auth-unlock-strip,
.auth-form-section,
.auth-form-stack,
.auth-panel-mini article {
  position: relative;
  overflow: hidden;
}
.auth-unlock-strip::after,
.auth-form-section::after,
.auth-form-stack::after,
.auth-panel-mini article::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.22) 18%, transparent 38%);
  opacity: .42;
  pointer-events: none;
}
.auth-form-header {
  margin-bottom: 2px;
}
.auth-form-section + .auth-form-section {
  margin-top: -2px;
}

.auth-password-row {
  align-items: start;
}
.form-group-password {
  align-content: start;
}
.password-meta {
  display: grid;
  gap: 8px;
  min-height: 48px;
  padding-top: 2px;
}
.password-meta-placeholder {
  align-content: center;
}
.form-group-password-confirm .strength-text {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
}
.auth-terms-detailed {
  display: grid;
  gap: 10px;
  align-items: start;
}
.auth-terms-detailed .auth-check {
  line-height: 1.75;
}
.auth-terms-detailed .auth-check input {
  margin-top: 3px;
}
.auth-terms-detailed a {
  color: #267ab8;
  font-weight: 700;
}
.auth-terms-note {
  margin: 0;
  color: #71839a;
  font-size: .9rem;
  line-height: 1.7;
  padding-left: 30px;
}
@media (max-width: 640px) {
  .password-meta {
    min-height: auto;
  }
  .auth-terms-note {
    padding-left: 0;
  }
}
