:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --background: #08111f;
  --panel: #101b2c;
  --panel-strong: #142238;
  --border: #263b58;
  --text: #f7f9fc;
  --muted: #94acd0;
  --blue: #4388ff;
  --blue-strong: #2869db;
  --green: #42dda4;
  --red: #ff7887;
}

* { box-sizing: border-box; }

body.auth-page {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(46, 115, 222, .2), transparent 34rem),
    radial-gradient(circle at 88% 86%, rgba(82, 62, 180, .15), transparent 30rem),
    var(--background);
}

.auth-shell { width: min(100%, 440px); }
.auth-brand { display: inline-flex; align-items: center; gap: 11px; margin-bottom: 22px; color: white; text-decoration: none; font-size: 22px; font-weight: 850; letter-spacing: -.5px; }
.auth-brand-name { color: white; white-space: nowrap; }
.auth-brand-name span { color: #65a0ff; }
.auth-logo { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(145deg, #4b91ff, #5947d7); color: white; box-shadow: 0 12px 32px rgba(50, 109, 220, .3); }
.auth-logo svg { width: 21px; height: 21px; }

.auth-card { padding: 30px; border: 1px solid var(--border); border-radius: 20px; background: rgba(16, 27, 44, .96); box-shadow: 0 24px 70px rgba(0, 0, 0, .28); }
.auth-kicker { margin: 0 0 8px; color: #73a8ff; font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.auth-card h1 { margin: 0; font-size: clamp(26px, 7vw, 34px); line-height: 1.08; letter-spacing: -.04em; }
.auth-description { margin: 12px 0 24px; color: var(--muted); line-height: 1.55; }
.auth-form { display: grid; gap: 16px; }
.auth-field { display: grid; gap: 7px; }
.auth-field label { color: #c9d8ef; font-size: 13px; font-weight: 750; }
.auth-field input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #334a69; border-radius: 11px; outline: none; background: #0b1524; color: white; font: inherit; transition: border-color .15s, box-shadow .15s; }
.auth-field input:focus { border-color: #5596ff; box-shadow: 0 0 0 3px rgba(67, 136, 255, .16); }
.auth-password-hint { color: var(--muted); font-size: 12px; line-height: 1.45; }
.auth-button { min-height: 48px; border: 1px solid transparent; border-radius: 11px; padding: 0 17px; cursor: pointer; background: linear-gradient(180deg, var(--blue), var(--blue-strong)); color: white; font: inherit; font-weight: 850; transition: transform .12s, filter .12s; }
.auth-button:hover { filter: brightness(1.08); }
.auth-button:active { transform: translateY(1px); }
.auth-button:disabled { cursor: wait; filter: grayscale(.3); opacity: .68; }
.auth-button.secondary { border-color: #344b6b; background: transparent; color: #d9e6f8; }
.auth-link { display: inline; border: 0; padding: 0; cursor: pointer; background: transparent; color: #83b2ff; font: inherit; font-weight: 750; }
.auth-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.auth-message { display: none; margin: 0 0 18px; padding: 12px 14px; border: 1px solid #345170; border-radius: 10px; background: #13233a; color: #cfe1fa; font-size: 13px; line-height: 1.45; }
.auth-message.show { display: block; }
.auth-message.error { border-color: rgba(255, 120, 135, .45); background: rgba(132, 37, 54, .18); color: #ffbdc4; }
.auth-message.success { border-color: rgba(66, 221, 164, .4); background: rgba(25, 122, 88, .16); color: #92f0ce; }
.auth-loader { width: 42px; height: 42px; margin: 10px auto 22px; border: 3px solid #283d5b; border-top-color: #5c9cff; border-radius: 50%; animation: spin .75s linear infinite; }
.auth-center { text-align: center; }
.auth-status { display: grid; gap: 10px; padding: 16px; border: 1px solid #2d4361; border-radius: 12px; background: #0c1727; }
.auth-status-row { display: flex; justify-content: space-between; gap: 16px; }
.auth-status-row span { color: var(--muted); }
.auth-status-row strong { text-align: right; }
.hidden { display: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
  body.auth-page { align-items: start; padding-top: 32px; }
  .auth-card { padding: 23px 19px; border-radius: 16px; }
  .auth-actions { align-items: flex-start; flex-direction: column; }
}
