:root {
  color-scheme: light;
  --auth-ink: #12203b;
  --auth-navy: #102149;
  --auth-blue: #1d53d9;
  --auth-muted: #59667c;
  --auth-line: #d5deea;
  --auth-mint: #8df0d2;
}

/* GDP direction: navy and blue carry trust; the single mint accent marks the product benefits.
   ENERGY 1 / RHYTHM 2 / MOTION 1: calm form-first layout with only functional focus feedback. */
.auth-page {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: radial-gradient(circle at 15% 10%, #dfeaff 0, transparent 36%), #f4f7fb;
  color: var(--auth-ink);
  font-family: "Plus Jakarta Sans", sans-serif;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  width: min(1080px, 100%);
  min-height: 680px;
  margin: auto;
  overflow: hidden;
  border: 1px solid #dce5f2;
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(32, 65, 120, .13);
}

.auth-story,
.auth-panel {
  min-width: 0;
}

.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  overflow: hidden;
  background: linear-gradient(145deg, #102149 0%, #1c3c86 58%, #275ff1 100%);
  color: #fff;
}

.auth-story::after {
  position: absolute;
  right: -120px;
  bottom: 80px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.auth-brand {
  position: relative;
  z-index: 1;
  color: #fff;
}

.auth-brand .brand-mark {
  border-color: rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .15);
}

.auth-brand small {
  color: #d4e0fa;
}

.auth-story-copy {
  position: relative;
  z-index: 1;
  max-width: 470px;
}

.auth-story h1 {
  margin: 20px 0;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.auth-story-copy p {
  max-width: 38ch;
  color: #f2f6ff;
  line-height: 1.7;
}

.auth-benefits {
  display: grid;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.auth-benefits li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.auth-benefits span {
  display: grid;
  flex: 0 0 26px;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
  color: var(--auth-mint);
}

.auth-legal {
  margin: 28px 0 0;
  color: #e0e8fa;
  font-size: 12px;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 50px 58px;
}

.auth-panel-head .kicker {
  color: var(--auth-blue);
}

.auth-panel-head h2 {
  margin: 8px 0;
  font-size: clamp(27px, 3vw, 32px);
  line-height: 1.18;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.auth-panel-head p {
  margin: 0 0 22px;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: 13px;
  background: #edf2f8;
}

.auth-tabs button {
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--auth-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tabs button[aria-selected="true"] {
  background: #fff;
  color: var(--auth-blue);
  box-shadow: 0 2px 8px rgba(22, 55, 110, .12);
}

.auth-form {
  display: grid;
  gap: 16px;
}

/* Author display rules must never override the HTML hidden state on inactive auth steps. */
.auth-shell [hidden],
.auth-form[hidden] {
  display: none !important;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #3b4962;
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  background: #fff;
  color: var(--auth-ink);
  font: inherit;
  font-size: 15px;
}

.auth-form input::placeholder {
  color: #65728b;
  opacity: 1;
}

.auth-form input:focus-visible {
  border-color: var(--auth-blue);
  outline: 3px solid rgba(29, 83, 217, .3);
  outline-offset: 1px;
}

.auth-form .otp-input {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .45em;
}

.register-intro {
  margin: 0 0 16px;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.auth-alert.is-error {
  border-color: #f2c6cf;
  background: #fff0f2;
  color: #8d1e34;
}

.auth-alert.is-success {
  border-color: #bcebdc;
  background: #eafaf4;
  color: #075c49;
}

.google-area {
  display: flex;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
}

#google-button {
  max-width: 100%;
}

#google-button iframe {
  max-width: 100%;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 17px 0;
  color: #5f6c82;
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  flex: 1;
  height: 1px;
  background: #e2e8f1;
  content: "";
}

.captcha-wrap {
  display: grid;
  justify-items: center;
  min-width: 0;
  margin-top: 18px;
}

.captcha-wrap p {
  max-width: 34ch;
  margin: 8px 0 0;
  color: #536179;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.cf-turnstile {
  max-width: 100%;
}

.auth-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 18px;
  margin-top: 17px;
  padding-top: 12px;
  border-top: 1px solid #e6ebf2;
  font-size: 13px;
}

.auth-footer a,
.text-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: #214f9e;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.text-button {
  justify-self: start;
  padding: 4px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.otp-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #d3e0f3;
  border-radius: 10px;
  background: #eef4ff;
  color: #34517e;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.button-wide {
  width: 100%;
  min-height: 48px;
  justify-content: center;
}

.button:disabled {
  opacity: .65;
  cursor: wait;
}

.auth-page :focus-visible {
  outline: 3px solid var(--auth-blue);
  outline-offset: 3px;
}

@media (max-width: 820px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    max-width: 620px;
    border-radius: 24px;
  }

  .auth-story {
    gap: 24px;
    padding: 28px 30px 24px;
  }

  .auth-story h1 {
    max-width: 18ch;
    margin: 18px 0 10px;
    font-size: clamp(30px, 5vw, 42px);
  }

  .auth-story-copy p {
    margin-bottom: 0;
  }

  .auth-benefits,
  .auth-legal {
    display: none;
  }

  .auth-panel {
    padding: 34px 30px 28px;
  }
}

@media (max-width: 560px) {
  .auth-page {
    place-items: start center;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .auth-shell {
    border-radius: 18px;
  }

  .auth-story {
    gap: 16px;
    padding: 22px 20px 20px;
  }

  .auth-story h1 {
    max-width: 20ch;
    margin: 14px 0 8px;
    font-size: clamp(27px, 8vw, 34px);
    line-height: 1.12;
  }

  .auth-story-copy p {
    font-size: 14px;
    line-height: 1.55;
  }

  .auth-panel {
    padding: 26px 20px 22px;
  }

  .auth-panel-head h2 {
    font-size: 27px;
  }

  .auth-panel-head p {
    margin-bottom: 18px;
    font-size: 14px;
  }

  .auth-tabs {
    margin-bottom: 18px;
  }

  .auth-form {
    gap: 14px;
  }

  .auth-form input {
    min-height: 50px;
    font-size: 16px;
  }

  .auth-footer {
    margin-top: 12px;
  }
}

@media (max-width: 360px) {
  .auth-story {
    padding-inline: 16px;
  }

  .auth-panel {
    padding-inline: 14px;
  }

  .auth-footer {
    justify-content: flex-start;
    gap: 0 20px;
  }
}

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