:root {
  --brand-violet: #7850F8;
  --brand-citron: #DFFF5E;
  --brand-ink: #211A2E;
  --brand-chalk: #F5F2FA;
  --auth-radius: 24px;
  --auth-control-radius: 11px;
}

body.auth-page {
  min-height: 100vh;
  background: var(--brand-chalk);
  color: var(--brand-ink);
  font-family: Payda, sans-serif;
}

.auth-page a { color: var(--brand-ink); text-underline-offset: 4px; }
.auth-page :focus-visible { outline: 3px solid var(--brand-violet); outline-offset: 3px; }
.auth-page input:focus-visible { outline-offset: 0; }

.auth-layout {
  display: grid;
  overflow: hidden;
  width: min(1120px, calc(100% - 48px));
  margin: 28px auto;
  border: 1px solid rgb(33 26 46 / .16);
  border-radius: var(--auth-radius);
  background: var(--brand-ink);
  box-shadow: 0 24px 70px rgb(33 26 46 / .13);
}

.auth-layout.login {
  min-height: min(680px, calc(100svh - 56px));
  grid-template-columns: minmax(0, 1fr) minmax(390px, .92fr);
}

.auth-brand {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(34px, 5vw, 66px);
  background: var(--brand-violet);
  color: #fff;
}

.auth-brand .brand-mark { display: inline-flex; align-items: center; line-height: 0; text-decoration: none; }
.auth-brand .brand-logo-dark { width: 164px; height: auto; }
.auth-brand-lead {
  max-width: 18ch;
  margin: 30px 0 22px;
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 800;
  line-height: 1.55;
}

.trust-list {
  display: grid;
  width: 100%;
  max-width: 38ch;
  gap: 15px;
  margin: 0;
  padding: 0;
  color: #fff;
  list-style: none;
  line-height: 1.9;
}

.trust-list li { position: relative; padding-inline-start: 24px; }
.trust-list li::before {
  position: absolute;
  top: .75em;
  inset-inline-start: 0;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--brand-citron);
  content: "";
}

.auth-home-link,
.auth-secondary {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1.5px solid var(--brand-violet);
  border-radius: var(--auth-control-radius);
  background: var(--brand-chalk);
  color: var(--brand-ink) !important;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-decoration: none !important;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.auth-home-link {
  margin-top: 30px;
  border-color: var(--brand-citron);
  background: transparent;
  color: #fff !important;
}

.auth-home-link:hover,
.auth-secondary:hover { border-color: var(--brand-citron); background: var(--brand-citron); }
.auth-brand .auth-home-link:hover { color: var(--brand-ink) !important; }
.auth-home-link:active,
.auth-secondary:active { transform: translateY(1px); }

.auth-card {
  min-width: 0;
  padding: clamp(30px, 4.2vw, 54px);
  border: 0;
  border-radius: 0;
  background: var(--brand-chalk);
  color: var(--brand-ink);
  box-shadow: -14px 0 36px rgb(33 26 46 / .10);
}

.auth-card-heading { margin-bottom: 28px; }
.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  color: var(--brand-ink);
  font-size: .9rem;
  font-weight: 700;
}

.auth-eyebrow::before {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--brand-violet);
  content: "";
}

.auth-card h1,
.auth-card h2 {
  margin: 0 0 8px;
  color: var(--brand-ink);
  font-size: clamp(1.65rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.5;
}

.auth-card .muted,
.auth-page label small { color: rgb(33 26 46 / .76); }
.auth-card .muted { margin: 0; }
.auth-form { display: grid; gap: 19px; }
.auth-field { display: grid; gap: 8px; }
.auth-page label { color: var(--brand-ink); font-size: .96rem; font-weight: 700; }
.auth-page label small { font-size: .86rem; font-weight: 400; line-height: 1.7; }

.auth-page input:not([type="radio"]),
.auth-page select,
.auth-page textarea {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgb(33 26 46 / .27);
  border-radius: var(--auth-control-radius);
  background: var(--brand-chalk);
  color: var(--brand-ink);
  font: inherit;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.auth-page input::placeholder { color: rgb(33 26 46 / .58); }
.auth-page input[dir="ltr"] { text-align: left; }
.auth-page input[type="password"] { direction: ltr; text-align: left; }
.auth-page input:not([type="radio"]):focus,
.auth-page select:focus,
.auth-page textarea:focus {
  border-color: var(--brand-violet);
  box-shadow: 0 0 0 3px rgb(120 80 248 / .18);
}

.auth-primary {
  display: inline-flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  padding: 12px 18px;
  border: 2px solid var(--brand-citron);
  border-radius: var(--auth-control-radius);
  background: var(--brand-citron);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background-color .16s ease, transform .16s ease;
}

.auth-primary:hover { border-color: var(--brand-ink); background: var(--brand-ink); color: var(--brand-citron); }
.auth-primary:active { transform: translateY(1px); }
.auth-primary:disabled { opacity: .55; cursor: not-allowed; }

.auth-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgb(33 26 46 / .18);
  color: var(--brand-ink);
}

.auth-switch .auth-secondary { min-height: 44px; flex: 0 0 auto; padding-inline: 14px; }
.admin-entry { display: grid; gap: 7px; margin-top: 20px; }
.admin-entry-label { color: rgb(33 26 46 / .76); font-size: .9rem; }
.auth-text-link { display: inline-flex; width: fit-content; align-items: center; gap: 8px; font-weight: 700; }
.auth-page .error {
  margin: 0 0 20px;
  padding: 12px 15px;
  border: 1px solid var(--brand-violet);
  border-inline-start-width: 4px;
  border-radius: 9px;
  background: var(--brand-chalk);
  color: var(--brand-ink);
  line-height: 1.8;
}

.auth-header {
  display: flex;
  width: 100%;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 12px max(4vw, 20px);
  border: 0;
  background: var(--brand-violet);
  box-shadow: 0 8px 24px rgb(33 26 46 / .12);
  direction: ltr;
}

.auth-header .brand-mark { display: inline-flex; align-items: center; line-height: 0; }
.auth-header .brand-logo { width: 136px; height: auto; }
.auth-header .auth-secondary { direction: rtl; }

.register-shell {
  grid-template-columns: minmax(0, 1fr) minmax(390px, .92fr);
  align-items: stretch;
  margin-block: 30px 56px;
}

.register-intro {
  min-width: 0;
  justify-content: flex-start;
  padding: clamp(34px, 5vw, 66px);
  background: var(--brand-violet);
  color: #fff;
}

.register-intro .brand-logo-dark { width: 164px; height: auto; }
.register-intro h1 { max-width: 18ch; margin: 24px 0 10px; color: #fff; font-size: clamp(1.8rem, 3vw, 2.25rem); font-weight: 800; line-height: 1.55; }
.register-intro p,
.register-intro .trust-list { color: #fff; line-height: 1.9; }
.register-intro p { max-width: 35ch; margin: 0; }
.register-intro .trust-list { gap: 12px; margin-top: 24px; }
.register-intro .auth-home-link { margin-top: 30px; border-color: var(--brand-citron); color: #fff !important; }
.register-intro .auth-home-link:hover { color: var(--brand-ink) !important; }
.platform-auth .auth-brand h1 { margin: 20px 0 8px; color: #fff; font-size: clamp(1.8rem, 2.6vw, 2.2rem); }
.platform-auth .auth-brand > p { max-width: 34ch; color: #fff; line-height: 1.9; }
.auth-page .platform-auth .auth-brand { border: 0; border-radius: 0; background: var(--brand-violet); }
.platform-badge { display: inline-flex; margin-bottom: 18px; padding: 7px 11px; border-radius: 8px; background: var(--brand-citron); color: var(--brand-ink); font-size: .86rem; font-weight: 700; }

.register-card { padding: clamp(28px, 4vw, 48px); }
.register-card .auth-card-heading { margin-bottom: 20px; }
.signup-form { display: grid; gap: 20px; margin: 0; }
.person-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; border: 0; }
.person-choice legend { grid-column: 1 / -1; margin-bottom: 2px; color: var(--brand-ink); font-weight: 700; }
.person-choice label {
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 11px;
  margin: 0;
  padding: 10px 13px;
  border: 1px solid rgb(33 26 46 / .24);
  border-radius: var(--auth-control-radius);
  background: var(--brand-chalk);
  cursor: pointer;
}

.person-choice label:has(input:checked) { border: 2px solid var(--brand-violet); background: var(--brand-citron); }
.person-choice input { flex: 0 0 20px; width: 20px; height: 20px; margin: 0; accent-color: var(--brand-violet); }
.form-grid { display: grid; gap: 19px 16px; align-items: start; }
.form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-group { display: grid; min-width: 0; grid-template-rows: 3.2rem 52px minmax(2.7rem, auto); gap: 7px; align-content: start; }
.field-group[hidden] { display: none !important; }
.auth-page .field-label { display: flex; min-height: 0; align-items: flex-end; line-height: 1.45; }
.auth-page .field-help { display: block; min-height: 2.7rem; font-size: .82rem; font-weight: 400; line-height: 1.55; }
.form-note { margin: 0; color: rgb(33 26 46 / .76); text-align: right; line-height: 1.8; }

@media (max-width: 900px) {
  .auth-layout { width: min(760px, calc(100% - 36px)); margin-block: 20px; }
  .auth-layout.login,
  .register-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px clamp(26px, 5vw, 44px); }
  .auth-brand-lead { max-width: 28ch; margin: 18px 0 14px; font-size: 1.7rem; }
  .trust-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: none; font-size: .91rem; }
  .auth-home-link { margin-top: 21px; }
  .auth-card { padding: clamp(28px, 5vw, 44px); box-shadow: 0 -12px 32px rgb(33 26 46 / .08); }
  .register-shell { margin-block: 20px 42px; }
  .register-intro { padding: 32px clamp(26px, 5vw, 44px); }
  .register-card { padding: clamp(28px, 5vw, 44px); }
}

@media (max-width: 600px) {
  .auth-layout,
  .register-shell { width: min(100% - 24px, 500px); margin: 12px auto 24px; border-radius: 17px; }
  .auth-layout.login { min-height: 0; }
  .auth-brand { padding: 24px 21px; }
  .auth-brand .brand-logo-dark { width: 140px; }
  .auth-brand-lead { margin: 14px 0 10px; font-size: 1.42rem; }
  .trust-list { grid-template-columns: 1fr; gap: 7px; font-size: .94rem; }
  .auth-home-link { min-height: 44px; margin-top: 15px; }
  .auth-card,
  .register-card { padding: 23px 19px; }
  .auth-card-heading { margin-bottom: 21px; }
  .auth-card h1,
  .auth-card h2 { font-size: 1.55rem; }
  .auth-form,
  .signup-form { gap: 17px; }
  .auth-switch { align-items: stretch; flex-direction: column; gap: 10px; margin-top: 20px; padding-top: 17px; }
  .auth-switch .auth-secondary { width: 100%; }
  .admin-entry { margin-top: 17px; }
  .auth-header { min-height: 68px; padding-inline: 16px; }
  .auth-header .brand-logo { width: 116px; }
  .auth-header .auth-secondary { min-height: 42px; padding: 7px 12px; }
  .register-intro { padding: 24px 21px; }
  .register-intro .brand-logo-dark { width: 140px; }
  .register-intro h1 { margin: 15px 0 9px; font-size: 1.62rem; }
  .register-intro .trust-list { gap: 7px; margin-top: 14px; }
  .register-intro .auth-home-link { margin-top: 17px; }
  .person-choice { grid-template-columns: 1fr 1fr; gap: 8px; }
  .person-choice label { min-height: 48px; gap: 7px; padding-inline: 9px; font-size: .9rem; }
  .form-grid.two-col { grid-template-columns: 1fr; gap: 13px; }
  .field-group { grid-template-rows: 2.5rem 50px auto; gap: 5px; }
  .auth-page .field-help { min-height: 0; }
  .auth-page input:not([type="radio"]),
  .auth-page select,
  .auth-page textarea { min-height: 50px; }
  .auth-primary { min-height: 52px; }
  .form-note { font-size: .9rem; }
}

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