:root {
  color-scheme: dark;
  --bg: #071018;
  --panel: #0e1a25;
  --border: #203548;
  --text: #e7eef6;
  --muted: #91a7b9;
  --blue: #5aa9ff;
  --green: #20c997;
  --red: #ff8585;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 5%, rgb(48 124 177 / 22%), transparent 34rem),
    radial-gradient(circle at 88% 85%, rgb(32 201 151 / 10%), transparent 32rem),
    var(--bg);
}

button, input { font: inherit; }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(22rem, .75fr);
  width: min(1120px, calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  align-items: center;
  gap: clamp(2.5rem, 7vw, 7rem);
  padding: 3rem 0;
}

.auth-intro { display: grid; gap: clamp(2rem, 6vh, 4.5rem); }
.auth-brand { display: flex; align-items: center; gap: 1rem; }
.auth-mark {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  color: #bfe0ff;
  border: 1px solid rgb(90 169 255 / 48%);
  border-radius: 1rem;
  background: linear-gradient(145deg, rgb(90 169 255 / 20%), rgb(32 201 151 / 8%));
  box-shadow: 0 18px 42px rgb(0 0 0 / 22%);
  font-size: 1.45rem;
  font-weight: 850;
}

h1, h2, p { margin: 0; }
h1 { margin-top: .16rem; font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.04em; }
h2 { margin-top: .3rem; font-size: clamp(1.65rem, 4vw, 2.6rem); line-height: 1.12; letter-spacing: -.045em; }
.eyebrow { color: var(--muted); font-size: .69rem; font-weight: 780; letter-spacing: .14em; text-transform: uppercase; }
.auth-copy { display: grid; gap: .7rem; max-width: 38rem; }
.auth-copy > p:last-child { max-width: 34rem; color: #aabcc9; line-height: 1.7; }

.auth-guardrails {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
  max-width: 38rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.auth-guardrails li {
  padding: .75rem .85rem;
  color: #bfd0dc;
  border: 1px solid rgb(47 73 95 / 75%);
  border-radius: .75rem;
  background: rgb(12 26 38 / 65%);
  font-size: .78rem;
  font-weight: 680;
}
.auth-guardrails span { margin-right: .4rem; color: var(--green); }

.auth-card {
  min-height: 31rem;
  padding: clamp(1.4rem, 4vw, 2.25rem);
  border: 1px solid rgb(47 73 95 / 92%);
  border-radius: 1.15rem;
  background: linear-gradient(145deg, rgb(17 31 44 / 98%), rgb(10 22 32 / 98%));
  box-shadow: 0 30px 80px rgb(0 0 0 / 34%);
}
.auth-card h2 { margin: .35rem 0 .65rem; font-size: 1.65rem; }
.auth-help { color: #9db0bf; font-size: .86rem; line-height: 1.55; }
.auth-card form { display: grid; gap: .55rem; margin-top: 1.55rem; }
.auth-card label { margin-top: .45rem; color: #c6d6e1; font-size: .78rem; font-weight: 720; }
.auth-card input {
  width: 100%;
  min-height: 3rem;
  padding: .72rem .8rem;
  color: var(--text);
  border: 1px solid #2a4358;
  border-radius: .7rem;
  outline: none;
  background: #08141e;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(90 169 255 / 14%); }
.password-field { position: relative; }
.password-field input { padding-right: 4.8rem; }
.reveal-password {
  position: absolute;
  right: .45rem;
  top: 50%;
  transform: translateY(-50%);
  padding: .38rem .55rem;
  color: #a9c7dd;
  border: 0;
  border-radius: .45rem;
  background: transparent;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}
.reveal-password:hover { background: rgb(90 169 255 / 10%); }
.reveal-password:focus-visible, .primary-action:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.primary-action {
  min-height: 3.1rem;
  margin-top: 1rem;
  color: #06111a;
  border: 0;
  border-radius: .72rem;
  background: linear-gradient(135deg, #76bbff, #4bd6ac);
  box-shadow: 0 12px 28px rgb(38 151 188 / 18%);
  font-weight: 820;
  cursor: pointer;
}
.primary-action:hover { filter: brightness(1.06); }
.primary-action:disabled { cursor: wait; filter: saturate(.5); opacity: .7; }
.auth-message {
  margin-top: 1rem;
  padding: .75rem .85rem;
  color: #ffd0d0;
  border: 1px solid rgb(255 107 107 / 38%);
  border-radius: .65rem;
  background: rgb(255 107 107 / 9%);
  font-size: .8rem;
  line-height: 1.45;
}
.auth-message[data-tone="success"] { color: #a9f2da; border-color: rgb(32 201 151 / 38%); background: rgb(32 201 151 / 9%); }
.auth-privacy { margin-top: 1.2rem; color: #71899a; font-size: .7rem; line-height: 1.5; }
.auth-loading { display: flex; align-items: center; justify-content: center; min-height: 25rem; gap: .8rem; color: var(--muted); font-size: .82rem; }
.spinner { width: 1rem; height: 1rem; border: 2px solid rgb(90 169 255 / 25%); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; width: min(100% - 1.25rem, 34rem); gap: 1.5rem; padding: 1.25rem 0 2rem; }
  .auth-intro { gap: 1.4rem; }
  .auth-copy h2 { font-size: 1.6rem; }
  .auth-copy > p:last-child { font-size: .86rem; }
  .auth-guardrails { grid-template-columns: 1fr 1fr; gap: .45rem; }
  .auth-guardrails li { padding: .6rem; font-size: .68rem; }
  .auth-card { min-height: 0; padding: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
