.auth-page {
  --auth-surface: color-mix(in srgb, var(--background-secondary) 82%, #111827 18%);
  --auth-surface-soft: color-mix(in srgb, var(--background-primary) 78%, var(--primary-color) 22%);
  --auth-line: color-mix(in srgb, var(--border-color) 76%, var(--primary-color) 24%);
  --auth-muted: color-mix(in srgb, var(--text-secondary) 88%, #fff 12%);
}

.auth-page .page-main.auth-page-main {
  min-height: calc(100svh - 74px);
  padding: clamp(1.1rem, 4vw, 3.5rem) 1rem clamp(2.25rem, 6vw, 5rem);
  background:
    radial-gradient(circle at 12% 12%, color-mix(in srgb, var(--primary-color) 16%, transparent), transparent 26rem),
    radial-gradient(circle at 90% 84%, rgba(59, 130, 246, .09), transparent 25rem),
    var(--background-primary);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(250px, .82fr) minmax(380px, 1.18fr);
  width: min(1040px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--auth-line);
  border-radius: clamp(18px, 3vw, 28px);
  background: var(--auth-surface);
  box-shadow: 0 28px 75px rgba(2, 8, 23, .32);
}

.auth-shell--login { width: min(940px, 100%); }

.auth-intro {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(2rem, 5vw, 4rem);
  overflow: hidden;
  border-right: 1px solid var(--auth-line);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--primary-color) 17%, transparent), transparent 58%),
    color-mix(in srgb, var(--background-primary) 90%, #111827 10%);
}

.auth-intro::after {
  position: absolute;
  right: -6rem;
  bottom: -7rem;
  width: 18rem;
  height: 18rem;
  border: 1px solid color-mix(in srgb, var(--primary-color) 28%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 2.5rem color-mix(in srgb, var(--primary-color) 4%, transparent),
              0 0 0 5rem color-mix(in srgb, var(--primary-color) 3%, transparent);
  content: "";
  pointer-events: none;
}

.auth-intro-copy, .auth-trust-list { position: relative; z-index: 1; }

.auth-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: .45rem;
  margin: 0 0 1.15rem;
  padding: .38rem .65rem;
  border: 1px solid color-mix(in srgb, var(--primary-color) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-color) 11%, transparent);
  color: color-mix(in srgb, var(--primary-color) 76%, #fff 24%);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.auth-intro h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(2rem, 4.7vw, 3.45rem);
  font-weight: 750;
  line-height: 1.06;
  letter-spacing: -.04em;
}

.auth-intro-copy > p:last-child {
  max-width: 42ch;
  margin: 1.15rem 0 0;
  color: var(--auth-muted);
  font-size: .96rem;
  line-height: 1.7;
}

.auth-trust-list { display: grid; gap: .8rem; }
.auth-trust-item { display: grid; grid-template-columns: 2rem 1fr; align-items: start; gap: .75rem; }
.auth-trust-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: .68rem;
  background: color-mix(in srgb, var(--primary-color) 14%, transparent);
  color: var(--primary-color);
  font-size: 1.05rem;
}
.auth-trust-item strong { display: block; color: var(--text-primary); font-size: .84rem; }
.auth-trust-item small { display: block; margin-top: .12rem; color: var(--auth-muted); line-height: 1.5; }

.auth-card {
  min-width: 0;
  padding: clamp(1.5rem, 4.5vw, 3.7rem);
  background: color-mix(in srgb, var(--background-secondary) 92%, var(--background-primary) 8%);
}

.auth-card-header { margin-bottom: 1.55rem; }
.auth-card-header .auth-eyebrow { margin: 0 0 .35rem; color: var(--primary-color); font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.auth-card-header h2 { margin: 0; color: var(--text-primary); font-size: clamp(1.55rem, 3.5vw, 2.1rem); letter-spacing: -.025em; }
.auth-card-header p { margin: .55rem 0 0; color: var(--auth-muted); font-size: .88rem; line-height: 1.65; }

.auth-page .social-btn,
.auth-page .telegram-auth-button {
  min-height: 50px;
  border-radius: 13px;
  font-size: .9rem;
}
.auth-page .social-btn { border-color: var(--auth-line); background: color-mix(in srgb, var(--background-primary) 72%, #fff 4%); }
.auth-page .social-btn:hover:not(:disabled), .auth-page .social-btn:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary-color) 58%, var(--border-color));
  box-shadow: 0 9px 24px rgba(2, 8, 23, .22);
  outline: none;
}
.auth-page .social-btn:disabled { opacity: .62; cursor: wait; }

.auth-inline-status {
  min-height: 1.35rem;
  margin: .65rem 0 0;
  color: var(--auth-muted);
  font-size: .76rem;
  line-height: 1.55;
  text-align: center;
}
.auth-inline-status[data-state="error"], .auth-field-message[data-state="error"] { color: #fca5a5; }
.auth-inline-status[data-state="success"], .auth-field-message[data-state="success"] { color: #86efac; }
.auth-inline-status[data-state="pending"] { color: #93c5fd; }

.auth-browser-help {
  display: grid;
  gap: .75rem;
  margin-top: .8rem;
  padding: .9rem;
  border: 1px solid color-mix(in srgb, #60a5fa 42%, var(--border-color));
  border-radius: 13px;
  background: color-mix(in srgb, #3b82f6 9%, var(--background-primary));
}
.auth-browser-help.hidden { display: none; }
.auth-browser-help p { margin: 0; color: var(--text-secondary); font-size: .76rem; line-height: 1.55; }
.auth-browser-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.auth-browser-actions a, .auth-browser-actions button {
  min-height: 38px;
  padding: .55rem .75rem;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  background: var(--background-primary);
  color: var(--text-primary) !important;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.auth-browser-actions a { border-color: #60a5fa; background: #2563eb; color: #fff !important; }

.auth-divider { display: flex; align-items: center; gap: .8rem; margin: 1.35rem 0; color: var(--auth-muted); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--auth-line); content: ""; }

.auth-page .form-group { margin-bottom: 1rem; }
.auth-page .form-group label:not(.checkbox-group label) { display: inline-block; margin-bottom: .42rem; color: var(--text-primary); font-size: .8rem; font-weight: 650; }
.auth-page .form-group input:not([type="checkbox"]):not([type="radio"]),
.auth-page .form-group select {
  width: 100%;
  min-height: 48px;
  padding: .78rem .9rem;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--background-primary) 78%, #fff 3%);
  color: var(--text-primary);
  font-size: .9rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.auth-page .form-group input:focus, .auth-page .form-group select:focus {
  border-color: var(--primary-color) !important;
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 18%, transparent);
}
.auth-page .form-group input[aria-invalid="true"] { border-color: #ef4444; }
.auth-field-message, .auth-page .input-note { min-height: 1.15rem; margin: .38rem 0 0; color: var(--auth-muted); font-size: .7rem; line-height: 1.5; }

.auth-page .btn-full { min-height: 49px; border-radius: 12px; font-size: .86rem; font-weight: 750; }
.auth-page .btn-full:disabled { opacity: .62; cursor: wait; }
.auth-page .auth-text-button { font-size: .76rem; }
.auth-page .password-toggle-icon { bottom: .48rem; min-width: 3.7rem; height: 2.2rem; }

.auth-page .registration-consent { margin: 1.2rem 0; border-radius: 14px; }
.auth-page .registration-consent .checkbox-group { align-items: flex-start; }
.auth-page .registration-consent input { margin-top: .25rem; }
.auth-page .registration-consent label { font-size: .72rem; line-height: 1.55; }

.auth-optional {
  margin: .95rem 0;
  border: 1px solid var(--auth-line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--background-primary) 47%, transparent);
}
.auth-optional > summary { padding: .85rem .95rem; color: var(--text-primary); font-size: .78rem; font-weight: 700; cursor: pointer; }
.auth-optional-fields { padding: .1rem .95rem .15rem; }
.auth-page .form-grid { gap: .8rem; }

.auth-security-check { margin: .85rem 0 1rem; border-radius: 13px; }
.auth-footer-link { margin: 1.2rem auto 0; color: var(--auth-muted); font-size: .82rem; text-align: center; }
.auth-footer-link a { font-weight: 700; }

.auth-otp-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--primary-color) 32%, var(--border-color));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary-color) 7%, var(--background-primary));
}
.auth-otp-panel h3 { margin: 0 0 .3rem; font-size: 1rem; }
.auth-otp-panel > p { margin: 0 0 .9rem; color: var(--auth-muted); font-size: .74rem; }

.auth-progress-card {
  width: min(520px, 100%);
  margin: clamp(2rem, 10vh, 7rem) auto;
  padding: clamp(1.6rem, 6vw, 3rem);
  border: 1px solid var(--auth-line);
  border-radius: 24px;
  background: var(--auth-surface);
  box-shadow: 0 24px 70px rgba(2, 8, 23, .34);
  text-align: center;
}
.auth-progress-logo { width: 54px; height: 54px; margin-bottom: 1rem; border-radius: 15px; }
.auth-progress-card h1 { margin: 0 0 .55rem; font-size: clamp(1.45rem, 5vw, 2rem); }
.auth-progress-card > p { margin: 0; }
.auth-progress-form { display: grid; gap: .8rem; margin-top: 1.25rem; text-align: left; }

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; width: min(600px, 100%); }
  .auth-intro { min-height: auto; padding: 1.5rem; border-right: 0; border-bottom: 1px solid var(--auth-line); }
  .auth-intro h1 { max-width: none; font-size: clamp(1.8rem, 8vw, 2.5rem); }
  .auth-intro-copy > p:last-child { margin-top: .7rem; }
  .auth-trust-list { display: none; }
  .auth-card { padding: clamp(1.3rem, 6vw, 2.4rem); }
}

@media (max-width: 520px) {
  .auth-page .page-main.auth-page-main { padding: .75rem .65rem 2.5rem; }
  .auth-shell { border-radius: 18px; }
  .auth-intro { padding: 1.2rem; }
  .auth-kicker { margin-bottom: .7rem; }
  .auth-card { padding: 1.2rem; }
  .auth-card-header { margin-bottom: 1.2rem; }
  .auth-browser-actions > * { width: 100%; justify-content: center; text-align: center; }
  .auth-page .form-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page *, .auth-page *::before, .auth-page *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
