:root {
  --navy: #102b3f;
  --ink: #173042;
  --blue: #2f72e2;
  --blue-deep: #1f56b8;
  --muted: #637481;
  --line: #dfe8ee;
  --sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(900px 420px at 12% -10%, #e8f0fd, transparent 70%),
    radial-gradient(700px 380px at 92% 0, #fdefe9, transparent 65%),
    #f6f9fb;
  color: var(--ink);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }

.auth-header {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--navy);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
}
.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3a7ff0, #1f56b8);
  box-shadow: 0 8px 18px rgba(47, 114, 226, .3);
}
.brand-mark::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
}
.auth-header a.back-link { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.auth-header a.back-link:hover { color: var(--blue); }

.auth-main { display: grid; place-items: center; padding: 12px 20px 40px; }

.auth-card {
  width: min(460px, 100%);
  padding: 32px 32px 28px;
  border: 1px solid #e5edf3;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(16, 43, 63, .12);
}
.auth-kicker {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-card h1 { margin: 0 0 8px; color: var(--navy); font: 600 30px/1.15 var(--serif); }
.auth-lede { margin: 0 0 22px; color: var(--muted); font-size: 14px; }

.field { display: grid; gap: 7px; margin-bottom: 15px; }
.field label { color: #31495b; font-size: 12px; font-weight: 700; }
.field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #d5e0e8;
  border-radius: 13px;
  outline: 0;
  background: #fbfdfe;
  font: 600 15px/1 var(--sans);
  color: inherit;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field input::placeholder { color: #93a6b2; font-weight: 500; }
.field input:hover { border-color: #bccbd6; }
.field input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(47, 114, 226, .12); }
.field input[aria-invalid="true"] { border-color: #c0392b; background: #fdf5f4; }
.field-hint { color: var(--muted); font-size: 11.5px; }
.field-error { color: #c0392b; font-size: 11.5px; font-weight: 600; }

.code-field input {
  height: 64px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .44em;
  text-align: center;
  text-indent: .44em;
  font-variant-numeric: tabular-nums;
}

.auth-button {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #3a7ff0, #1f56b8);
  color: #fff;
  font: 700 14.5px/1 var(--sans);
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(31, 86, 184, .26);
  transition: transform .18s, box-shadow .18s, opacity .18s;
}
.auth-button:hover { transform: translateY(-1px); box-shadow: 0 16px 30px rgba(31, 86, 184, .32); }
.auth-button:disabled { opacity: .6; cursor: wait; transform: none; box-shadow: none; }

.auth-secondary {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: 600 13px/1.4 var(--sans);
  cursor: pointer;
}
.auth-secondary:hover { text-decoration: underline; text-underline-offset: 2px; }

.auth-status { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.auth-status[data-state="error"] { color: #c0392b; }
.auth-status[data-state="success"] { color: #1d7a52; }

.auth-alt {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid #edf3f7;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.auth-alt a { font-weight: 700; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; text-underline-offset: 2px; }

.auth-aside {
  margin: 18px auto 0;
  width: min(460px, 100%);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.auth-footer {
  padding: 20px 24px 30px;
  color: #8296a3;
  font-size: 12px;
  text-align: center;
}
.auth-footer a { color: #8296a3; text-decoration: none; }
.auth-footer a:hover { color: var(--blue); }

[hidden] { display: none !important; }

@media (max-width: 560px) {
  .auth-card { padding: 26px 20px 22px; border-radius: 20px; }
  .auth-card h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-button { transition: none; }
}
