.auth-page {
  --auth-accent: var(--accent, #4d7cfe);
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--bg);
  color: var(--ink);
}

.auth-left,
.auth-right {
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
}

.auth-left {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: var(--s7) var(--s8);
  background: var(--bg);
  border-left: 1px solid var(--border);
}

.auth-left::before,
.auth-left::after {
  position: absolute;
  content: "";
  pointer-events: none;
  border-radius: 50%;
}

.auth-left::before {
  top: -20%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, color-mix(in srgb, var(--auth-accent) 12%, transparent), transparent 70%);
}

.auth-left::after {
  bottom: -10%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, color-mix(in srgb, var(--success) 8%, transparent), transparent 70%);
}

.auth-brand,
.auth-mobile-logo {
  color: var(--ink);
  text-decoration: none;
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--s2);
  min-height: 44px;
}

.auth-brand-name,
.auth-mobile-logo-name {
  font-weight: 800;
  letter-spacing: -.02em;
}

.auth-brand-name { font-size: 1.1rem; }

.panel-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--s5);
  max-width: 28rem;
}

.auth-headline-title {
  margin: 0 0 var(--s3);
  color: var(--ink);
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.1;
  text-wrap: balance;
}

.auth-headline-title .accent { color: var(--auth-accent); }

.auth-headline-sub {
  margin: 0;
  color: var(--ink-2);
  font-size: .9rem;
  line-height: 1.7;
}

.auth-trust {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-trust li {
  display: flex;
  align-items: center;
  gap: var(--s2);
  color: var(--ink-2);
  font-size: .8rem;
}

.auth-trust li::before {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--auth-accent);
  content: "";
}

.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: var(--s7) var(--s8);
  background: var(--surface);
  overscroll-behavior: contain;
}

.auth-form-wrap {
  width: 100%;
  max-width: 390px;
  margin-block: auto;
}

.auth-mobile-logo { display: none; }

.auth-form-title {
  margin: 0 0 var(--s2);
  color: var(--ink);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.3;
  text-wrap: balance;
}

.auth-form-sub {
  margin: 0 0 var(--s6);
  color: var(--ink-2);
  font-size: .9rem;
  line-height: 1.65;
  text-wrap: pretty;
}

.auth-error,
.auth-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  margin-bottom: var(--s4);
  padding: 11px var(--s3);
  border: 1px solid;
  border-radius: var(--r-md);
  font-size: .85rem;
  line-height: 1.6;
}

.auth-error {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
  background: var(--danger-bg);
  color: var(--danger);
}

.auth-notice {
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
  background: var(--success-bg);
  color: var(--success);
}

.auth-status-icon { flex: 0 0 auto; margin-top: 2px; }

.auth-field { margin-bottom: var(--s4); }

.auth-field label {
  display: block;
  margin-bottom: var(--s2);
  color: var(--ink-2);
  font-size: .84rem;
  font-weight: 600;
}

.auth-input-wrap { position: relative; }

.auth-field input {
  width: 100%;
  height: 50px;
  box-sizing: border-box;
  padding: 0 var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
  transition: border-color 180ms cubic-bezier(.22, 1, .36, 1), box-shadow 180ms cubic-bezier(.22, 1, .36, 1), background-color 180ms ease;
  -webkit-text-fill-color: var(--ink);
}

.auth-field input::placeholder { color: var(--ink-2); opacity: .78; }

.auth-field input:hover { border-color: var(--border-2); }

.auth-field input:focus-visible {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 18%, transparent);
}

.auth-field input[aria-invalid="true"] {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger-bg) 45%, var(--surface));
}

.auth-field input[type="password"] { padding-left: 54px; }

.auth-password-toggle {
  position: absolute;
  top: 3px;
  left: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}

.auth-password-toggle:hover { background: var(--surface-2); color: var(--ink); }
.auth-password-toggle:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 1px; }
.auth-password-toggle svg { width: 20px; height: 20px; }

.auth-field-hint,
.auth-field-error {
  display: block;
  margin-top: 6px;
  font-size: .78rem;
  line-height: 1.55;
}

.auth-field-hint { color: var(--ink-2); }
.auth-field-error { color: var(--danger); font-weight: 600; }
.auth-field-error[hidden] { display: none; }

.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus {
  border-color: var(--border);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  -webkit-text-fill-color: var(--ink);
  transition: background-color 5000s ease-in-out 0s;
}

.auth-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  width: 100%;
  min-height: 50px;
  margin-top: var(--s2);
  padding: 0 var(--s5);
  border: 0;
  border-radius: var(--r-md);
  background: var(--auth-accent);
  color: #fff;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 180ms cubic-bezier(.22, 1, .36, 1), transform 180ms cubic-bezier(.22, 1, .36, 1), box-shadow 180ms cubic-bezier(.22, 1, .36, 1);
}

.auth-submit:hover { background: var(--accent-dark); box-shadow: 0 6px 18px color-mix(in srgb, var(--auth-accent) 28%, transparent); transform: translateY(-1px); }
.auth-submit:active { transform: translateY(0); box-shadow: none; }
.auth-submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--auth-accent) 42%, transparent); outline-offset: 3px; }
.auth-submit:disabled { opacity: .68; cursor: wait; transform: none; box-shadow: none; }

.auth-spinner {
  display: none;
  width: 17px;
  height: 17px;
  box-sizing: border-box;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin .7s linear infinite;
}

.auth-submit[data-loading="true"] .auth-spinner { display: inline-block; }

@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px var(--s2);
  margin-top: var(--s4);
  color: var(--ink-2);
  font-size: .84rem;
  line-height: 1.8;
}

.auth-links a,
.auth-terms a {
  color: var(--accent-text, var(--auth-accent));
  font-weight: 700;
  text-underline-offset: 3px;
}

.auth-links a { text-decoration: none; }
.auth-links a:hover,
.auth-links a:focus-visible,
.auth-terms a:hover,
.auth-terms a:focus-visible { text-decoration: underline; }
.auth-links a:focus-visible,
.auth-terms a:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 3px; border-radius: 3px; }
.auth-links-sep { color: var(--ink-3); }

.auth-terms {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  margin: var(--s3) 0 var(--s2);
  color: var(--ink-2);
  font-size: .82rem;
  line-height: 1.65;
}

.auth-terms-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
}

.auth-terms input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--auth-accent);
  cursor: pointer;
}

.auth-terms > label { padding-top: 10px; cursor: pointer; }

@media (max-width: 860px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right {
    align-items: center;
    justify-content: flex-start;
    padding: max(28px, env(safe-area-inset-top, 0px)) var(--s4) max(var(--s6), env(safe-area-inset-bottom, 0px));
    background: var(--bg);
  }
  .auth-form-wrap { max-width: 420px; margin-block: 0; }
  .auth-mobile-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin-bottom: var(--s5);
  }
  .auth-mobile-logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    background: var(--auth-accent);
  }
  .auth-mobile-logo-name { font-size: 1.1rem; }
}

@media (max-width: 640px) {
  .auth-form-title { font-size: 1.5rem; }
  .auth-form-sub { margin-bottom: var(--s5); }
  .auth-field input,
  .auth-submit { min-height: 52px; font-size: 1rem; }
  .auth-password-toggle { top: 4px; }
  .auth-links { font-size: .875rem; }
}

@media (min-width: 861px) and (max-height: 760px) {
  .auth-right { align-items: flex-start; justify-content: flex-start; padding-block: var(--s5); }
  .auth-form-wrap { margin-block: 0; }
}

@media (prefers-color-scheme: dark) {
  .auth-left::before { background: radial-gradient(circle, rgba(90,130,192,.12), transparent 70%); }
  .auth-left::after { background: radial-gradient(circle, rgba(16,185,129,.06), transparent 70%); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-field input,
  .auth-submit { transition: none; }
  .auth-spinner { animation-duration: 1.4s; }
}
