:root {
  --auth-navy: #07376d;
  --auth-blue: #075eb8;
  --auth-blue-dark: #064d96;
  --auth-text: #142033;
  --auth-muted: #5f6f82;
  --auth-border: #cbd5e1;
  --auth-surface: #ffffff;
  --auth-page: #eef3f8;
  --auth-danger: #b42318;
  --auth-danger-bg: #fef3f2;
  --auth-danger-border: #fecdca;
  --auth-success: #027a48;
  --auth-success-bg: #ecfdf3;
  --auth-success-border: #abefc6;
  --auth-warning: #b54708;
  --auth-warning-bg: #fffaeb;
  --auth-warning-border: #fedf89;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body.auth-page {
  min-height: 100vh;
  margin: 0;
  background: var(--auth-page);
  color: var(--auth-text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(280px, 42%) minmax(420px, 58%);
  min-height: 100vh;
}

.auth-brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 48px;
  background: var(--auth-navy);
  color: #fff;
}

.auth-brand::before,
.auth-brand::after {
  position: absolute;
  right: -12%;
  bottom: -18%;
  width: 85%;
  height: 46%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50% 50% 0 0;
  content: "";
  transform: rotate(-8deg);
}

.auth-brand::after {
  right: 18%;
  bottom: -28%;
  width: 105%;
  height: 55%;
  opacity: .55;
  transform: rotate(9deg);
}

.auth-brand-inner { position: relative; z-index: 1; width: min(330px, 100%); text-align: center; }
.auth-logo { display: block; max-width: 270px; max-height: 150px; margin: 0 auto 28px; object-fit: contain; filter: brightness(0) invert(1); }
.auth-brand-title { margin: 0; font-size: 25px; font-weight: 650; letter-spacing: .01em; }
.auth-brand-copy { margin: 10px 0 0; color: rgba(255,255,255,.76); font-size: 14px; letter-spacing: .05em; text-transform: uppercase; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px clamp(28px, 7vw, 104px); background: var(--auth-surface); }
.auth-card { width: min(440px, 100%); }
.auth-heading { margin: 0 0 10px; font-size: clamp(30px, 3vw, 40px); line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
.auth-lead { margin: 0 0 32px; color: var(--auth-muted); font-size: 16px; }
.auth-form { margin-top: 28px; }
.auth-field { margin-bottom: 22px; }
.auth-label { display: block; margin-bottom: 8px; color: var(--auth-text); font-size: 14px; font-weight: 650; }
.auth-input-wrap { position: relative; }
.auth-input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 10px 44px 10px 14px;
  border: 1px solid var(--auth-border);
  border-radius: 6px;
  background: #fff;
  color: var(--auth-text);
  font: inherit;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.auth-input:focus { outline: 0; border-color: var(--auth-blue); box-shadow: 0 0 0 3px rgba(7,94,184,.16); }
.auth-input::placeholder { color: #8a98a9; }
.auth-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 36px;
  min-height: 36px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--auth-blue);
  font-size: 12px;
  font-weight: 650;
  transform: translateY(-50%);
  cursor: pointer;
}
.auth-toggle:focus { outline: 2px solid var(--auth-blue); outline-offset: 1px; border-radius: 3px; }
.auth-help { margin: 8px 0 0; color: var(--auth-muted); font-size: 13px; }
.auth-submit {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 28px;
  padding: 11px 18px;
  border: 1px solid var(--auth-blue);
  border-radius: 6px;
  background: var(--auth-blue);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.auth-submit:hover { border-color: var(--auth-blue-dark); background: var(--auth-blue-dark); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:focus { outline: 3px solid rgba(7,94,184,.25); outline-offset: 2px; }
.auth-secondary { margin: 22px 0 0; text-align: center; }
.auth-link { color: var(--auth-blue); font-weight: 650; text-decoration: none; }
.auth-link:hover, .auth-link:focus { color: var(--auth-blue-dark); text-decoration: underline; }

.auth-alert { display: flex; gap: 12px; margin: 0 0 24px; padding: 14px 16px; border: 1px solid; border-radius: 6px; font-size: 14px; }
.auth-alert strong { display: block; margin-bottom: 2px; }
.auth-alert-danger { border-color: var(--auth-danger-border); background: var(--auth-danger-bg); color: var(--auth-danger); }
.auth-alert-success { border-color: var(--auth-success-border); background: var(--auth-success-bg); color: var(--auth-success); }
.auth-alert-warning { border-color: var(--auth-warning-border); background: var(--auth-warning-bg); color: var(--auth-warning); }
.auth-alert-icon { flex: 0 0 22px; width: 22px; height: 22px; border: 2px solid currentColor; border-radius: 50%; text-align: center; font-weight: 800; line-height: 18px; }

.auth-strength { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; margin-top: 9px; }
.auth-strength span { height: 4px; border-radius: 4px; background: #d9e1ea; }
.auth-strength[data-score="1"] span:nth-child(-n+1) { background: #d92d20; }
.auth-strength[data-score="2"] span:nth-child(-n+2) { background: #dc6803; }
.auth-strength[data-score="3"] span:nth-child(-n+3) { background: #039855; }
.auth-strength[data-score="4"] span { background: #039855; }

@media (max-width: 760px) {
  .auth-shell { display: block; min-height: 100vh; }
  .auth-brand { min-height: 108px; padding: 20px 24px; justify-content: flex-start; }
  .auth-brand::before, .auth-brand::after { display: none; }
  .auth-brand-inner { display: flex; align-items: center; width: 100%; text-align: left; }
  .auth-logo { width: auto; max-width: 150px; max-height: 66px; margin: 0 18px 0 0; }
  .auth-brand-title { font-size: 17px; }
  .auth-brand-copy { display: none; }
  .auth-main { min-height: calc(100vh - 108px); align-items: flex-start; padding: 42px 24px 56px; }
  .auth-heading { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
