@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  --font-family-headings: Montserrat, Inter, "Segoe UI", Roboto, Arial, sans-serif;
  --bg: #f3f6fb;
  --card: #ffffff;
  --line: #d9e1ec;
  --text: #16202f;
  --muted: #5a6b83;
  --brand: #1f6feb;
  --brand-2: #1658bb;
  --ok: #1b8f58;
  --err: #b42336;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 18px 42px rgba(15, 30, 55, 0.1);
  --shadow-soft: 0 10px 24px rgba(15, 30, 55, 0.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-family);
  color: var(--text);
  background:
    radial-gradient(1100px 420px at 95% -18%, #e8efff, transparent 66%),
    radial-gradient(720px 280px at 18% 12%, #edf4ff, transparent 60%),
    radial-gradient(640px 220px at 50% 100%, rgba(231, 239, 252, 0.65), transparent 58%),
    var(--bg);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(620px 200px at 0% 0%, rgba(31, 111, 235, 0.08), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: var(--shadow);
}

.auth-page {
  min-height: 100dvh;
  padding: 22px;
  display: grid;
  place-items: center;
}

.auth-layout {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
}

.auth-card__brand {
  display: flex;
  justify-content: center;
}

.auth-card__logo {
  width: auto;
  height: 44px;
  display: block;
}

.auth-card__eyebrow,
.step-title {
  font-family: var(--font-family-headings);
}

.auth-card h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
  font-family: var(--font-family-headings);
  font-size: clamp(28px, 3.3vw, 38px);
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 44ch;
}

.auth-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(620px 200px at 0% 0%, rgba(31, 111, 235, 0.08), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.auth-card__head {
  display: grid;
  gap: 6px;
}

.auth-card__eyebrow {
  color: #335a8f;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tab {
  min-height: 44px;
  border: 1px solid #c0d0e4;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.tab.is-active {
  border-color: #9fc0ef;
  background: linear-gradient(180deg, #f0f6ff 0%, #e5f0ff 100%);
  color: #184b95;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

.auth-form { display: grid; gap: 12px; }
.auth-form.is-hidden { display: none; }

.auth-step {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow-soft);
}

.auth-step.is-hidden { display: none; }

.step-title {
  font-size: 14px;
  font-weight: 700;
  color: #2b466d;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
  font-size: 15px;
  line-height: 1.35;
}

.field input::placeholder { color: #8193ab; }

.field input:focus {
  outline: none;
  border-color: #76a6ec;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  min-height: 44px;
  border-radius: var(--radius-md);
  padding: 0 14px;
  border: 1px solid var(--brand-2);
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 22px rgba(31, 111, 235, 0.18);
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.btn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(31, 111, 235, 0.22);
}

.btn:disabled { opacity: .55; pointer-events: none; }

.status {
  min-height: 24px;
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--muted);
}

.status.success { color: var(--ok); }
.status.error { color: var(--err); }

.auth-footer {
  width: min(1040px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: var(--shadow-soft);
  padding: 16px 18px;
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.auth-footer__top,
.auth-footer__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.auth-footer__dot { opacity: .6; }

.auth-footer__link {
  color: var(--brand);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .auth-layout { width: min(560px, 100%); }
}

@media (max-width: 560px) {
  .auth-page { padding: 12px; }
  .auth-card {
    border-radius: 18px;
    padding: 16px;
  }
  .auth-card h2 { font-size: 28px; }
  .auth-card__logo { height: 38px; }
  .auth-footer {
    border-radius: 18px;
    padding: 12px;
  }
  .auth-footer__top,
  .auth-footer__links {
    justify-content: flex-start;
    gap: 6px;
    font-size: 12px;
  }
}
