:root {
  --navy: #0A2342;
  --gold: #FFC107;
  --muted: #687888;
  --auth-motion: 720ms;
  --auth-ease: cubic-bezier(.65, 0, .35, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; }
body.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  color: #263646;
  background: linear-gradient(135deg, rgba(3,44,99,.64), rgba(7,90,156,.42)), url('UnamedV.2.png') center / cover fixed;
}
.auth-shell {
  position: relative;
  width: 1000px;
  max-width: 100%;
  height: clamp(580px, calc(100dvh - 96px), 720px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 28px;
  background: transparent;
  box-shadow: 0 24px 70px rgba(1,33,79,.38);
  isolation: isolate;
}
.auth-form {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  padding: 32px 38px;
  background: rgba(255,255,255,.9);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #9ab1c5 transparent;
  transition: transform var(--auth-motion) var(--auth-ease), opacity 200ms ease, visibility 0s 250ms;
}
.auth-form-login { opacity: 1; visibility: visible; transition-delay: 0s, 350ms, 0s; }
.auth-form-register { opacity: 0; visibility: hidden; pointer-events: none; }
.is-register .auth-form { transform: translateX(-100%); }
.is-register .auth-form-login { opacity: 0; visibility: hidden; pointer-events: none; transition-delay: 0s, 0s, 250ms; }
.is-register .auth-form-register { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s, 350ms, 0s; }
.auth-welcome {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 2;
  width: 50%;
  overflow: hidden;
  border-radius: 0 130px 130px 0;
  background: linear-gradient(145deg, rgba(18,59,103,.86), rgba(10,35,66,.9) 75%);
  color: #fff;
  transition: transform var(--auth-motion) var(--auth-ease), border-radius var(--auth-motion) var(--auth-ease);
}
.auth-welcome::before, .auth-welcome::after {
  content: '';
  position: absolute;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(255,193,7,.18);
  border-radius: 50%;
  pointer-events: none;
}
.auth-welcome::before { top: -155px; left: -100px; }
.auth-welcome::after { bottom: -170px; right: -90px; width: 380px; height: 380px; }
.is-register .auth-welcome { transform: translateX(100%); border-radius: 130px 0 0 130px; }
.welcome-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px;
  text-align: center;
  transition: opacity 220ms ease, transform var(--auth-motion) var(--auth-ease), visibility 0s 250ms;
}
.welcome-eyebrow { color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: 3px; }
.welcome-content h2 { font-size: clamp(27px, 3vw, 38px); line-height: 1.15; }
.welcome-content p { color: #dae5ef; font-size: 15px; line-height: 1.8; }
.welcome-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  min-height: 46px;
  padding: 12px 24px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}
.welcome-button:hover { background: white; color: var(--navy); }
.welcome-login { opacity: 1; visibility: visible; transition-delay: 350ms, 0s, 0s; }
.welcome-register { opacity: 0; visibility: hidden; transform: translateX(35%); pointer-events: none; }
.is-register .welcome-login { opacity: 0; visibility: hidden; transform: translateX(-35%); pointer-events: none; transition-delay: 0s, 0s, 250ms; }
.is-register .welcome-register { opacity: 1; visibility: visible; transform: translateX(0); pointer-events: auto; transition-delay: 350ms, 0s, 0s; }
.logo { text-align: center; margin-bottom: 22px; }
.logo-img { display: block; width: 68px; height: 68px; margin: 0 auto 12px; border: 3px solid var(--gold); border-radius: 50%; object-fit: cover; }
.logo h1 { color: var(--navy); font-size: 22px; margin-bottom: 6px; }
.logo p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.form-title { text-align: center; font-size: 25px; color: var(--navy); margin-bottom: 24px; }
.input-group { margin-bottom: 18px; }
label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--navy); font-weight: 600; }
.auth-form input:not([type='checkbox']):not([type='hidden']), .auth-form select {
  width: 100%;
  padding: 12px;
  border: 1px solid #C9D6E0;
  border-radius: 8px;
  background: #F5F8FB;
  color: #263646;
  font-size: 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.auth-form input:focus, .auth-form select:focus { border-color: #168DD1; box-shadow: 0 0 0 3px rgba(22,141,209,.15); }
.show-password { margin-bottom: 16px; font-size: 13px; line-height: 1.5; }
.show-password input, .terms input { accent-color: var(--navy); width: 16px; height: 16px; margin-right: 5px; vertical-align: middle; }
.btn, .register-btn { width: 100%; padding: 13px; border: none; border-radius: 8px; background: var(--gold); color: var(--navy); font-weight: 700; font-size: 14px; cursor: pointer; transition: background 180ms ease; }
.btn:hover, .register-btn:hover { background: #e0aa00; }
.links, .login { margin-top: 18px; text-align: center; font-size: 13px; line-height: 1.7; color: var(--muted); }
.links a, .login a { color: var(--navy); font-weight: 700; text-decoration: none; }
.links a:hover, .login a:hover { text-decoration: underline; }
.signup { margin-top: 10px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fields > div { min-width: 0; }
.full { grid-column: 1 / -1; }
.required { color: #D94343; }
.type-card { position: relative; padding: 14px; background: #F8FBFF; border: 1px solid #C9D6E0; border-radius: 10px; cursor: pointer; transition: border-color 180ms ease, background 180ms ease; }
.type-card.selected { border-color: var(--navy); background: #EAF6FF; box-shadow: 0 0 0 2px rgba(10,35,66,.12); }
.type-card h3 { color: var(--navy); font-size: 14px; margin: 0 0 7px; padding-right: 12px; }
.type-card p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.type-card-check { display: none; position: absolute; right: 8px; top: 8px; width: 18px; height: 18px; place-items: center; color: #fff; border-radius: 50%; background: var(--navy); font-size: 12px; }
.type-card.selected .type-card-check { display: grid; }
.password-container { position: relative; }
.auth-form .password-container input { padding-right: 64px !important; }
.toggle-password { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; padding: 7px; background: transparent; color: var(--navy); font-size: 12px; font-weight: 700; cursor: pointer; }
#passwordRequirements { line-height: 1.7; color: var(--muted); }
.email-feedback { min-height: 18px; margin-top: 5px; color: var(--muted); font-size: 12px; }
.email-feedback.invalid { color: #D94343; }
.email-feedback.valid { color: #188754; }
.terms { display: flex; align-items: flex-start; gap: 6px; margin: 20px 0; }
.terms input { flex-shrink: 0; margin-top: 3px; }
.terms label { color: var(--muted); font-size: 12px; line-height: 1.5; }
#message { display: none; }
#pwa-install-btn { position: fixed; top: 12px; right: 14px; z-index: 5; padding: 10px 14px; border: none; border-radius: 8px; background: var(--gold); color: var(--navy); font-weight: 700; cursor: pointer; }
a:focus-visible, button:focus-visible, .type-card:focus-visible { outline: 3px solid #168DD1; outline-offset: 3px; }
.welcome-button:focus-visible { outline-color: var(--gold); }
@media (max-width: 760px) {
  body.auth-page { padding: 16px 12px; }
  body.auth-page { display: block; background-attachment: scroll; }
  .auth-shell { width: 560px; height: auto; min-height: 0; margin: 0 auto; border-radius: 22px; }
  .auth-welcome { position: relative; width: 100%; height: 200px; inset: auto; border-radius: 0 0 55px 55px; }
  .is-register .auth-welcome { transform: none; border-radius: 0 0 55px 55px; }
  .welcome-content { padding: 20px; gap: 10px; }
  .welcome-eyebrow { font-size: 10px; }
  .welcome-content h2 { font-size: 26px; }
  .welcome-content p { font-size: 13px; line-height: 1.5; }
  .welcome-button { min-height: 40px; padding: 9px 20px; }
  .auth-shell { display: flex; flex-direction: column; }
  .auth-welcome { order: -1; flex-shrink: 0; }
  .auth-form { position: relative; left: auto; top: auto; width: 100%; height: auto; padding: 25px; overflow: visible; }
  .auth-form-register, .is-register .auth-form-login { display: none; transform: none; }
  .auth-form-login, .is-register .auth-form-register { display: block; transform: none; }
  .logo-img { width: 56px; height: 56px; }
  .logo { margin-bottom: 18px; }
}
@media (max-width: 420px) {
  .auth-form { padding: 24px 20px; }
  .fields { grid-template-columns: 1fr; }
  .form-title { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-form, .auth-welcome, .welcome-content { transition: none; }
}
.auth-session-feedback { color: #b33131; line-height: 1.5; margin: 0 0 16px; }
