:root {
  --auth-ink: #152238;
  --auth-muted: #5f6f85;
  --auth-subtle: #eef3f8;
  --auth-border: #d8e1eb;
  --auth-primary: #1769e0;
  --auth-primary-dark: #0e4fae;
  --auth-primary-soft: #e8f1ff;
  --auth-success: #16794c;
  --auth-danger: #b42318;
  --auth-shadow: 0 24px 70px rgba(21, 34, 56, .14);
  --auth-radius: 20px;
  --auth-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html { min-height: 100%; }

body.auth-page {
  min-height: 100vh;
  margin: 0;
  color: var(--auth-ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(44, 126, 232, .18), transparent 34rem),
    linear-gradient(135deg, #f6f9fc 0%, #edf3f8 100%);
  font-family: var(--auth-font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--auth-primary-dark); }
a:hover { color: var(--auth-primary); }

:focus-visible {
  outline: 3px solid rgba(23, 105, 224, .35);
  outline-offset: 3px;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(260px, .82fr) minmax(0, 1.18fr);
  width: min(1100px, calc(100% - 40px));
  min-height: min(700px, calc(100vh - 56px));
  margin: 28px auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(216, 225, 235, .9);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
}

.auth-shell--single { display: block; max-width: 720px; min-height: 0; }

.auth-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 6vw, 72px) clamp(28px, 5vw, 56px);
  overflow: hidden;
  color: #fff;
  background: linear-gradient(155deg, #103f83 0%, #1769e0 54%, #2c91d7 100%);
}

.auth-aside::before,
.auth-aside::after {
  position: absolute;
  content: "";
  width: 230px;
  height: 230px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
}

.auth-aside::before { right: -120px; top: 70px; box-shadow: 0 0 0 24px rgba(255,255,255,.04), 0 0 0 48px rgba(255,255,255,.035); }
.auth-aside::after { left: -180px; bottom: -130px; }

.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h2 { max-width: 300px; margin: 52px 0 16px; color: #fff; font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.12; letter-spacing: -.03em; }
.auth-aside p { max-width: 320px; margin: 0; color: rgba(255,255,255,.8); }
.auth-aside__note { margin-top: auto; padding-top: 40px; color: rgba(255,255,255,.72); font-size: .83rem; }

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -.02em;
  text-decoration: none;
}

.auth-brand__mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 11px;
  font-size: .86rem;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-card { padding: clamp(30px, 6vw, 70px); }
.auth-card__brand { margin-bottom: 48px; color: var(--auth-primary-dark); }
.auth-card__brand .auth-brand__mark { color: #fff; background: var(--auth-primary); border-color: var(--auth-primary); }
.auth-card__heading { margin-bottom: 30px; }
.auth-kicker { margin: 0 0 10px; color: var(--auth-primary-dark); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.auth-card h1 { margin: 0 0 12px; color: var(--auth-ink); font-size: clamp(1.8rem, 4vw, 2.65rem); line-height: 1.1; letter-spacing: -.045em; }
.auth-lead { max-width: 590px; margin: 0; color: var(--auth-muted); font-size: 1rem; }

.auth-form { max-width: 540px; }
.auth-form--narrow { max-width: 420px; }
.auth-field { margin: 0 0 21px; }
.auth-label { display: block; margin: 0 0 8px; color: var(--auth-ink); font-size: .86rem; font-weight: 700; }
.auth-input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 15px;
  color: var(--auth-ink);
  background: #fff;
  border: 1px solid var(--auth-border);
  border-radius: 11px;
  font: inherit;
  font-size: 1rem;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.auth-input::placeholder { color: #8b99aa; }
.auth-input:hover { border-color: #aebdce; }
.auth-input:focus { border-color: var(--auth-primary); box-shadow: 0 0 0 4px rgba(23,105,224,.12); outline: 0; }
.auth-input[aria-invalid="true"] { border-color: var(--auth-danger); }
.auth-help { margin: 8px 0 0; color: var(--auth-muted); font-size: .82rem; }

.auth-message { min-height: 24px; margin: 0 0 16px; color: var(--auth-danger); font-size: .88rem; font-weight: 650; }
.auth-message:empty { min-height: 0; margin-bottom: 0; }
.auth-message--success { color: var(--auth-success); }
.auth-message--info { color: var(--auth-muted); }
.auth-message a { color: inherit; }

.auth-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 27px; }
.auth-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  color: #fff;
  background: var(--auth-primary);
  border: 1px solid var(--auth-primary);
  border-radius: 10px;
  box-shadow: 0 7px 16px rgba(23,105,224,.2);
  cursor: pointer;
  font: inherit;
  font-size: .93rem;
  font-weight: 750;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.auth-button:hover { background: var(--auth-primary-dark); box-shadow: 0 9px 20px rgba(23,105,224,.28); transform: translateY(-1px); }
.auth-button:active { transform: translateY(0); }
.auth-button:disabled { cursor: wait; opacity: .7; transform: none; }
.auth-secondary { color: var(--auth-muted); font-size: .88rem; text-decoration: none; }
.auth-secondary:hover { color: var(--auth-primary-dark); text-decoration: underline; }

.auth-divider { height: 1px; margin: 34px 0 21px; background: var(--auth-subtle); border: 0; }
.auth-footer { padding-top: 26px; color: #728096; font-size: .78rem; }
.auth-footer a { color: #53647a; }
.auth-footer__links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }

.auth-links { display: grid; gap: 12px; margin: 28px 0 0; }
.auth-link-card { display: block; padding: 17px 18px; color: var(--auth-ink); background: #f8fbff; border: 1px solid var(--auth-border); border-radius: 12px; text-decoration: none; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.auth-link-card:hover { background: var(--auth-primary-soft); border-color: #9cbbe8; transform: translateY(-1px); }
.auth-link-card strong { display: block; margin-bottom: 3px; font-size: .95rem; }
.auth-link-card span { color: var(--auth-muted); font-size: .82rem; }
.auth-copy { margin-top: 32px; color: var(--auth-muted); font-size: .91rem; }
.auth-copy h2 { margin: 28px 0 8px; color: var(--auth-ink); font-size: 1.05rem; }
.auth-copy p { margin: 0 0 14px; }

.auth-alert { margin: 22px 0; padding: 14px 16px; background: var(--auth-primary-soft); border: 1px solid #c7dcfa; border-radius: 11px; color: #264d7c; font-size: .88rem; }
.auth-alert--success { background: #ecfdf3; border-color: #b7e5cb; color: var(--auth-success); }
.auth-alert--error { background: #fff1f0; border-color: #f5c2bd; color: var(--auth-danger); }
.auth-alert p { margin: 0 0 8px; }
.auth-alert p:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
  .auth-shell { display: block; width: min(100% - 24px, 560px); min-height: 0; margin: 12px auto; border-radius: 16px; }
  .auth-aside { display: none; }
  .auth-card { padding: 30px 24px 25px; }
  .auth-card__brand { margin-bottom: 38px; }
  .auth-card h1 { font-size: 2rem; }
  .auth-footer__links { gap: 5px 12px; }
}

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