.auth-gate {
  min-height: calc(100vh - 80px);
  padding: clamp(30px, 5vw, 76px) clamp(16px, 5vw, 72px);
  background:
    radial-gradient(circle at 76% 12%, rgba(23, 123, 112, .16), transparent 34%),
    radial-gradient(circle at 8% 88%, rgba(67, 117, 144, .10), transparent 30%),
    linear-gradient(135deg, #eef6f6 0%, #f7faf9 55%, #eaf2f3 100%);
}

.auth-gate-inner {
  width: min(1180px, 100%);
  min-height: min(620px, calc(100vh - 160px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, .75fr);
  align-items: center;
  gap: clamp(36px, 7vw, 110px);
}

.auth-gate-story {
  padding: clamp(14px, 3vw, 44px) 0;
  color: var(--navy);
}

.auth-story-kicker {
  margin: 0 0 18px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}

.auth-gate-story h2 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 1.04;
  letter-spacing: -.055em;
}

.auth-story-copy {
  max-width: 560px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.65;
}

.auth-story-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 40px;
}

.auth-story-stats div {
  display: grid;
  gap: 3px;
  min-width: 100px;
}

.auth-story-stats strong {
  color: var(--navy);
  font-size: 30px;
  letter-spacing: -.04em;
}

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

.auth-story-footnote {
  margin: 38px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-gate-card {
  width: 100%;
  padding: clamp(28px, 4vw, 44px);
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(215, 225, 233, .9);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(22, 49, 69, .16);
}

.auth-flow-card { min-height: 520px; }
.auth-flow-panel { display: grid; gap: 18px; }
.auth-flow-panel.hidden { display: none; }
.auth-flow-panel form { gap: 16px; }
.auth-flow-links { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-top: 2px; }
.auth-secondary-action { width: 100%; min-height: 48px; }
.auth-flow-heading { display: grid; gap: 12px; }
.auth-flow-heading h2 { margin: 0; color: var(--navy); font-size: 29px; }
.auth-back-button { justify-self: start; padding: 0; border: 0; background: transparent; color: var(--blue); font: inherit; font-weight: 750; cursor: pointer; }
.auth-back-button:hover { color: var(--teal); }
.auth-sent-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #dbf1eb; color: var(--teal); font-size: 28px; font-weight: 850; }
.auth-email-address { margin: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #f5f8fa; color: var(--ink) !important; font-weight: 750; overflow-wrap: anywhere; }
.auth-flow-help { margin: 0 !important; font-size: 13px; line-height: 1.65; }

.auth-gate-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.auth-gate-brand .brand-mark {
  width: 48px;
  height: 48px;
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.auth-gate-brand h2 {
  margin: 2px 0 0;
  color: var(--navy);
  font-size: 29px;
  letter-spacing: -.03em;
}

.auth-gate-lede {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-gate-card form {
  display: grid;
  gap: 14px;
}

.auth-gate-card label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.auth-gate-card input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid #b8c7d2;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.auth-gate-card input:focus {
  border-color: var(--teal);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(23, 123, 112, .15);
}

.auth-gate-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
  border-radius: 11px;
  font-size: 15px;
}

.auth-restore-message {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
}

.auth-restore-message::before {
  content: "";
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: happyrun-spin .7s linear infinite;
}

.auth-gate[data-session-state="restoring"] .auth-gate-card {
  cursor: wait;
}

.auth-gate[data-session-state="restoring"] input:disabled,
.auth-gate[data-session-state="restoring"] button:disabled {
  cursor: wait;
}

.auth-gate-card .auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 0;
}

.auth-gate-card .button {
  min-height: 48px;
  border-radius: 11px;
}

.auth-gate-card .auth-link {
  display: block;
  margin: 0 auto;
  padding: 2px 8px;
  color: var(--navy);
  font-weight: 800;
}

.auth-gate-note {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 900px) {
  .auth-gate-inner {
    grid-template-columns: 1fr;
    max-width: 620px;
    gap: 20px;
    min-height: auto;
  }

  .auth-gate-story {
    padding: 12px 0;
  }

  .auth-gate-story h2 {
    font-size: clamp(38px, 9vw, 60px);
  }

  .auth-story-stats {
    margin-top: 26px;
  }
}

@media (max-width: 520px) {
  .auth-gate {
    min-height: calc(100vh - 64px);
    padding: 28px 12px 44px;
  }

  .auth-gate-card {
    padding: 26px 20px;
    border-radius: 18px;
  }

  .auth-flow-card { min-height: auto; }
  .auth-flow-links { grid-template-columns: 1fr; gap: 4px; }
  .auth-link { justify-self: start; margin: 0; }

  .auth-gate-brand h2 {
    font-size: 25px;
  }

  .auth-gate-story h2 {
    font-size: 42px;
  }

  .auth-story-copy {
    font-size: 15px;
  }

  .auth-story-stats {
    gap: 16px;
  }

  .auth-story-stats strong {
    font-size: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-restore-message::before { animation: none; border-right-color: currentColor; border-bottom-color: transparent; }
}
