:root {
  --preauth-navy: #12263A;
  --preauth-deep-navy: #0B1F33;
  --preauth-blue: #2F6FED;
  --preauth-page: #F7F9FC;
  --preauth-text: #172433;
  --preauth-muted: #64748B;
  --preauth-border: #E2E8F0;
  --preauth-danger: #B91C1C;
}

* { box-sizing: border-box; }

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

body.preauth-body {
  margin: 0;
  background: var(--preauth-page);
  color: var(--preauth-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.preauth-header {
  min-height: 92px;
  background: #fff;
  border-bottom: 1px solid var(--preauth-border);
}

.preauth-header-inner {
  width: min(100% - 48px, 1488px);
  min-height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.preauth-logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.preauth-logo img { display: block; width: 186px; height: auto; }
.preauth-nav { display: flex; align-items: center; gap: 22px; font-size: 15px; font-weight: 600; }
.preauth-nav a { color: var(--preauth-navy); text-decoration: none; }
.preauth-nav a:hover, .preauth-nav a:focus-visible { color: var(--preauth-blue); }
.preauth-locale { display: inline-flex; align-items: center; gap: 9px; }
.preauth-locale a[aria-current="page"] { color: var(--preauth-blue); }
.preauth-locale span { color: #94A3B8; font-weight: 400; }
.preauth-nav-divider { width: 1px; height: 32px; background: var(--preauth-border); }
.preauth-back { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.preauth-back-icon { font-size: 18px; line-height: 1; }

.preauth-main {
  min-height: calc(100vh - 92px);
  padding: 94px 16px 104px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.preauth-card {
  width: min(100%, 640px);
  background: #fff;
  border: 1px solid #D7E0EB;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(18, 38, 58, .08);
  overflow: hidden;
}

.preauth-card-body { padding: 56px 64px 30px; }
.preauth-card h1 { margin: 0; color: var(--preauth-deep-navy); font-size: clamp(32px, 4vw, 44px); line-height: 1.08; letter-spacing: -.035em; }
.preauth-lede { margin: 18px 0 40px; color: var(--preauth-muted); font-size: 17px; line-height: 1.5; }
.preauth-field { display: block; margin: 0 0 12px; color: var(--preauth-deep-navy); font-size: 16px; font-weight: 650; }
.preauth-input {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #fff;
  color: var(--preauth-text);
  font: inherit;
  font-size: 17px;
  outline: none;
}
.preauth-input::placeholder { color: #94A3B8; }
.preauth-input:hover { border-color: #94A3B8; }
.preauth-input:focus { border-color: var(--preauth-blue); box-shadow: 0 0 0 3px rgba(47, 111, 237, .16); }
.preauth-input[aria-invalid="true"] { border-color: #EF233C; }
.preauth-error { margin: 11px 0 0; color: var(--preauth-danger); font-size: 16px; line-height: 1.4; }
.preauth-submit {
  width: 100%;
  min-height: 58px;
  margin-top: 26px;
  border: 0;
  border-radius: 8px;
  background: var(--preauth-blue);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}
.preauth-submit:hover:not(:disabled), .preauth-submit:focus-visible:not(:disabled) { background: #245BC7; }
.preauth-submit:disabled { background: #DCE8FA; color: #8AA4CC; cursor: not-allowed; }
.preauth-submit:focus-visible, .preauth-back:focus-visible, .preauth-locale a:focus-visible, .preauth-secondary a:focus-visible { outline: 3px solid rgba(47, 111, 237, .35); outline-offset: 3px; border-radius: 4px; }
.preauth-pending { margin: 12px 0 0; color: var(--preauth-muted); text-align: center; font-size: 15px; }
.preauth-pending::before { content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 9px 1px 0; border-radius: 50%; background: #8DB4FF; }
.preauth-secondary { margin: 24px 0 0; text-align: center; font-size: 17px; }
.preauth-secondary a { color: var(--preauth-blue); text-decoration: none; }
.preauth-secondary a:hover { text-decoration: underline; }
.preauth-secondary-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 22px; }
.preauth-note { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 76px; margin-top: 30px; border-top: 1px solid var(--preauth-border); color: var(--preauth-muted); font-size: 16px; }
.preauth-lock { width: 22px; height: 22px; color: #8693A8; flex: 0 0 auto; }
.preauth-card-footer { padding: 38px 64px 42px; border-top: 1px solid var(--preauth-border); }
.preauth-card-footer h2 { margin: 0 0 27px; color: var(--preauth-deep-navy); font-size: 18px; }
.preauth-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.preauth-step { display: grid; grid-template-columns: 38px 1fr; align-items: start; gap: 10px; color: var(--preauth-muted); font-size: 15px; line-height: 1.35; }
.preauth-step-number { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #EDF4FF; color: #5B83C8; font-weight: 700; }
.preauth-step p { margin: 2px 0 0; }
.preauth-success { padding: 14px 16px; border: 1px solid #BBE4C8; border-radius: 8px; background: #F0FBF3; color: #166534; line-height: 1.45; }

@media (max-width: 700px) {
  .preauth-header-inner { width: min(100% - 32px, 1488px); min-height: 76px; }
  .preauth-header { min-height: 76px; }
  .preauth-logo img { width: 146px; }
  .preauth-nav { gap: 12px; font-size: 14px; }
  .preauth-nav-divider { height: 24px; }
  .preauth-main { min-height: calc(100vh - 76px); padding: 38px 12px 56px; }
  .preauth-card-body, .preauth-card-footer { padding-left: 24px; padding-right: 24px; }
  .preauth-card-body { padding-top: 36px; }
  .preauth-lede { margin-bottom: 30px; font-size: 16px; }
  .preauth-steps { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 390px) {
  .preauth-header-inner { width: min(100% - 24px, 1488px); gap: 10px; }
  .preauth-logo img { width: 128px; }
  .preauth-nav { gap: 8px; font-size: 13px; }
  .preauth-nav-divider { display: none; }
  .preauth-card h1 { font-size: 31px; }
  .preauth-card-body, .preauth-card-footer { padding-left: 18px; padding-right: 18px; }
}
