:root {
  --auth-red: #c8102e;
  --auth-ink: #141719;
  --auth-muted: #697178;
  --auth-line: #dfe3e6;
  --auth-bg: #f3f4f5;
  --auth-ok: #277a46;
  --auth-warn: #a56a00;
  --auth-bad: #a2232f;
}

html.auth-pending body > :not(.auth-boot-screen) { visibility: hidden; }
html.auth-ready .auth-boot-screen { display: none !important; }

.auth-boot-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  background: var(--auth-bg);
  color: var(--auth-ink);
}
.auth-boot-card {
  width: min(460px, calc(100% - 32px));
  padding: 34px;
  border: 1px solid var(--auth-line);
  border-top: 4px solid var(--auth-red);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0,0,0,.09);
  text-align: center;
}
.auth-boot-card img { width: 145px; height: auto; }
.auth-boot-card strong { display: block; margin-top: 22px; font-size: 19px; }
.auth-boot-card span { display: block; margin-top: 8px; color: var(--auth-muted); font-size: 13px; }
.auth-spinner {
  width: 34px;
  height: 34px;
  margin: 24px auto 0;
  border: 3px solid #e7e9eb;
  border-top-color: var(--auth-red);
  border-radius: 50%;
  animation: auth-spin .85s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-page {
  min-height: 100vh;
  margin: 0;
  background: var(--auth-bg);
  color: var(--auth-ink);
  font-family: "Segoe UI", Arial, sans-serif;
}
.auth-page * { box-sizing: border-box; }
.auth-topline { height: 3px; background: var(--auth-red); }
.auth-page-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 26px;
  border-bottom: 1px solid var(--auth-line);
  background: #fff;
}
.auth-page-brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.auth-page-brand img { width: 142px; height: auto; display: block; }
.auth-page-brand-copy { padding-left: 18px; border-left: 1px solid var(--auth-line); }
.auth-page-brand-copy strong { display: block; font-size: 15px; }
.auth-page-brand-copy span { display: block; margin-top: 4px; color: var(--auth-muted); font-size: 11px; }
.auth-page-header-actions { display: flex; align-items: center; gap: 10px; }
.auth-page-link,
.auth-page-button-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--auth-line);
  border-radius: 6px;
  background: #fff;
  color: var(--auth-ink);
  text-decoration: none;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.auth-page-link:hover,
.auth-page-button-link:hover { border-color: #bcc2c7; background: #f8f9fa; }

.auth-login-main {
  width: min(980px, calc(100% - 32px));
  min-height: calc(100vh - 71px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .75fr);
  gap: 70px;
  align-items: center;
  padding: 54px 0 70px;
}
.auth-intro .eyebrow {
  color: var(--auth-red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}
.auth-intro h1 { max-width: 620px; margin: 12px 0 18px; font-size: clamp(40px, 5vw, 66px); line-height: 1.02; letter-spacing: -.035em; }
.auth-intro p { max-width: 590px; margin: 0; color: var(--auth-muted); font-size: 17px; line-height: 1.65; }
.auth-feature-list { display: grid; gap: 15px; margin-top: 30px; }
.auth-feature { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.auth-feature-icon {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 7px; background: #fae8ec; color: var(--auth-red); font-weight: 800;
}
.auth-feature strong { display: block; font-size: 13px; }
.auth-feature span { display: block; margin-top: 3px; color: var(--auth-muted); font-size: 12px; line-height: 1.45; }

.auth-card {
  width: 100%;
  padding: 30px;
  border: 1px solid var(--auth-line);
  border-top: 4px solid var(--auth-red);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(0,0,0,.08);
}
.auth-card h2 { margin: 0; font-size: 25px; }
.auth-card > p { margin: 8px 0 0; color: var(--auth-muted); font-size: 13px; line-height: 1.55; }
.auth-secure-state {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; padding: 7px 10px; border-radius: 999px;
  background: #f3f4f5; color: var(--auth-muted); font-size: 10px; font-weight: 800;
}
.auth-secure-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #aab0b5; }
.auth-secure-state.is-ok { background: #eaf5ee; color: var(--auth-ok); }
.auth-secure-state.is-ok::before { background: var(--auth-ok); }
.auth-secure-state.is-bad { background: #fae9eb; color: var(--auth-bad); }
.auth-secure-state.is-bad::before { background: var(--auth-bad); }
.auth-form { display: grid; gap: 16px; margin-top: 24px; }
.auth-field label { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 800; }
.auth-field input {
  width: 100%; height: 46px; padding: 0 13px;
  border: 1px solid #cfd4d8; border-radius: 6px;
  background: #fff; color: var(--auth-ink); font: inherit; font-size: 14px;
  outline: none;
}
.auth-field input:focus { border-color: var(--auth-red); box-shadow: 0 0 0 3px rgba(200,16,46,.10); }
.auth-password-wrap { position: relative; }
.auth-password-wrap input { padding-right: 88px; }
.auth-password-toggle {
  position: absolute; right: 5px; top: 5px; height: 36px; padding: 0 10px;
  border: 0; border-radius: 5px; background: #f1f3f4; color: #3e4449;
  font-size: 10px; font-weight: 800; cursor: pointer;
}
.auth-primary-button {
  min-height: 46px; border: 0; border-radius: 6px;
  background: var(--auth-red); color: #fff; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
}
.auth-primary-button:hover { background: #aa0d27; }
.auth-primary-button:disabled { opacity: .55; cursor: not-allowed; }
.login-message,
.password-message {
  margin-top: 16px; padding: 12px 13px; border-radius: 6px;
  background: #f3f4f5; color: #50575d; font-size: 12px; line-height: 1.5;
}
.login-message.is-error,
.password-message.is-error { background: #fae9eb; color: var(--auth-bad); }
.login-message.is-warning,
.password-message.is-warning { background: #fff4df; color: var(--auth-warn); }
.login-message.is-success,
.password-message.is-success { background: #eaf5ee; color: var(--auth-ok); }
.auth-card-footer {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid #eceeef;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.auth-card-footer span { color: var(--auth-muted); font-size: 10px; line-height: 1.4; }
.auth-text-button { border: 0; background: transparent; color: var(--auth-red); font-size: 10px; font-weight: 800; cursor: pointer; padding: 0; text-align: right; }

.password-main {
  width: min(760px, calc(100% - 32px));
  margin: 48px auto 80px;
}
.password-main h1 { margin: 0; font-size: 37px; }
.password-main > p { margin: 12px 0 26px; color: var(--auth-muted); line-height: 1.6; }
.password-card { padding: 28px; border: 1px solid var(--auth-line); border-radius: 10px; background: #fff; }
.password-info { margin-bottom: 22px; padding: 14px; border-radius: 7px; background: #f6f7f8; color: var(--auth-muted); font-size: 12px; line-height: 1.55; }
.password-info strong { color: var(--auth-ink); }
.password-actions { display: flex; justify-content: flex-end; margin-top: 20px; }

button.header-nav-button { font-family: inherit; cursor: pointer; }
.auth-logout-button { color: #4f565c; }
.auth-user-chip { display: inline-flex; align-items: center; padding: 0 10px; min-height: 32px; border-radius: 999px; background: #f3f4f5; color: #5f666d; font-size: 10px; font-weight: 800; }

@media (max-width: 840px) {
  .auth-login-main { grid-template-columns: 1fr; gap: 34px; padding-top: 38px; }
  .auth-intro h1 { font-size: 43px; }
  .auth-page-header { padding: 0 16px; }
  .auth-page-brand-copy { display: none; }
}
@media (max-width: 520px) {
  .auth-page-brand img { width: 118px; }
  .auth-login-main { width: min(100% - 22px, 980px); }
  .auth-card { padding: 23px 20px; }
  .auth-page-header-actions .auth-page-link:first-child { display: none; }
}
