.auth-page {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--page);
}

.auth-header {
  display: flex;
  width: min(1320px, calc(100% - 72px));
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-inline: auto;
}

.auth-header .brand-mark {
  width: 38px;
  height: 38px;
}

.auth-header-actions {
  display: flex;
  align-items: center;
  gap: 25px;
}

.auth-header-actions .theme-toggle {
  gap: 9px;
}

.auth-creator-footer {
  display: flex;
  justify-content: center;
  padding: 8px 14px 22px;
}

.auth-creator-footer .creator-credit {
  margin: 0;
  font-size: clamp(0.75rem, 3.5vw, 0.88rem);
}

.auth-layout {
  display: grid;
  width: min(1320px, calc(100% - 72px));
  min-height: min(730px, calc(100svh - 112px));
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  align-items: stretch;
  gap: clamp(44px, 7.2vw, 112px);
  margin: 8px auto 28px;
}

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 0 48px;
}

.auth-form-wrap {
  width: min(100%, 438px);
  margin-inline: auto;
  animation: auth-appear 520ms cubic-bezier(.2, .7, .25, 1) both;
}

.auth-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.15px;
  text-transform: uppercase;
}

.auth-eyebrow span {
  font-size: 15px;
}

.auth-form-wrap h1 {
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: clamp(32px, 3.2vw, 42px);
  font-weight: 700;
  letter-spacing: -1.8px;
  line-height: 1.14;
}

.auth-intro {
  margin: 11px 0 25px;
  color: var(--muted);
  font-size: 14px;
}

.auth-status {
  margin: -8px 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
}

.auth-status[data-state="loading"] {
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  color: var(--green-dark);
}

.auth-status[data-state="success"] {
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  background: color-mix(in srgb, var(--surface-green) 82%, var(--surface));
  color: var(--green-dark);
}

.auth-status[data-state="error"] {
  border-color: #dfb7a8;
  background: color-mix(in srgb, #fff1ec 80%, var(--surface));
  color: #8b3f2a;
}

html[data-theme="dark"] .auth-status[data-state="error"] {
  border-color: #70483d;
  background: #33221e;
  color: #f0bca8;
}

.auth-form[hidden] {
  display: none;
}

.auth-provider[hidden] {
  display: none;
}

.auth-provider {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
}

.auth-provider-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.auth-provider-divider::before,
.auth-provider-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.google-auth-button {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.google-auth-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  background: var(--surface-soft);
}

.google-auth-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.google-auth-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.auth-form {
  display: grid;
  gap: 18px;
  animation: auth-appear 300ms ease both;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field > label,
.auth-label-row > label {
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 700;
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-field input {
  width: 100%;
  min-height: 49px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-strong);
  font: inherit;
  font-size: 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 180ms ease;
}

.auth-field input::placeholder {
  color: var(--muted-soft);
  opacity: 1;
}

.auth-field input:hover {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
}

.auth-field input:focus-visible {
  border-color: var(--green);
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 16%, transparent);
}

.auth-field input[aria-invalid="true"],
.auth-field input[aria-invalid="true"]:focus-visible {
  border-color: #c7614b;
  box-shadow: 0 0 0 3px rgb(199 97 75 / 12%);
}

.password-toggle,
.auth-inline-link {
  border: 0;
  background: transparent;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

html[data-theme="dark"] .password-toggle,
html[data-theme="dark"] .auth-inline-link {
  color: var(--green);
}

.password-toggle {
  padding: 3px 0 3px 8px;
}

.auth-inline-link:hover,
.password-toggle:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.field-error {
  min-height: 0;
  color: #a33e2e;
  font-size: 10px;
  line-height: 1.4;
}

.field-error:empty {
  display: none;
}

html[data-theme="dark"] .field-error {
  color: #ffac95;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: -2px;
}

.check-label {
  display: inline-flex;
  min-height: 24px;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1.5;
}

.check-label input {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin: 1px 0 0;
  accent-color: var(--green);
  cursor: pointer;
}

.check-label input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--green) 35%, transparent);
  outline-offset: 2px;
}

.auth-submit {
  display: flex;
  width: 100%;
  min-height: 51px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 1px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #16845d;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #0f6949;
  box-shadow: 0 8px 20px rgb(15 105 73 / 18%);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: .8;
}

.submit-arrow {
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}

.auth-switch {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.terms-row {
  display: grid;
  gap: 4px;
}

.password-strength {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

.strength-track {
  height: 4px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--line);
}

.strength-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #c67a44;
  transition: width 180ms ease, background-color 180ms ease;
}

.password-strength[data-strength="good"] .strength-track span {
  background: #d2a634;
}

.password-strength[data-strength="strong"] .strength-track span {
  background: var(--green);
}

.recovery-help {
  margin: -5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.auth-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 23px 0 0;
  color: var(--muted-soft);
  font-size: 10px;
}

.auth-footnote span {
  color: var(--green);
  font-size: 14px;
}

.auth-story {
  position: relative;
  display: flex;
  min-height: 650px;
  align-items: center;
  overflow: hidden;
  padding: clamp(42px, 6vw, 82px);
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 27px;
  background: linear-gradient(145deg, #124c39 0%, #0c6548 52%, #0f7652 100%);
  color: #f4faf6;
  isolation: isolate;
}

.auth-story::before,
.auth-story::after {
  position: absolute;
  z-index: -1;
  width: 500px;
  height: 500px;
  border: 1px solid rgb(218 246 229 / 10%);
  border-radius: 50%;
  content: "";
}

.auth-story::before {
  top: -315px;
  right: -170px;
  box-shadow: 0 0 0 38px rgb(218 246 229 / 3%), 0 0 0 76px rgb(218 246 229 / 3%);
}

.auth-story::after {
  right: -300px;
  bottom: -362px;
  width: 620px;
  height: 620px;
}

.story-glow {
  position: absolute;
  z-index: -1;
  width: 290px;
  height: 290px;
  border-radius: 50%;
  filter: blur(85px);
  opacity: .22;
}

.story-glow-one {
  top: 7%;
  left: -16%;
  background: #a1ddb5;
}

.story-glow-two {
  right: -12%;
  bottom: 10%;
  background: #a8c86b;
  opacity: .16;
}

.story-content {
  width: 100%;
  max-width: 485px;
  margin-inline: auto;
  animation: auth-appear 640ms 90ms cubic-bezier(.2, .7, .25, 1) both;
}

.story-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 21px;
  color: #c7e6d4;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.25px;
  text-transform: uppercase;
}

.story-kicker span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a7e3ba;
  box-shadow: 0 0 0 4px rgb(167 227 186 / 14%);
}

.story-content h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 4.5vw, 57px);
  font-weight: 600;
  letter-spacing: -2.3px;
  line-height: 1.09;
}

.story-copy {
  max-width: 340px;
  margin: 17px 0 34px;
  color: #c4ddd0;
  font-size: 13px;
  line-height: 1.7;
}

.story-art {
  position: relative;
  overflow: hidden;
  padding: 19px 21px 17px;
  border: 1px solid rgb(255 255 255 / 17%);
  border-radius: 15px;
  background: linear-gradient(145deg, rgb(248 255 250 / 15%), rgb(226 247 236 / 8%));
  box-shadow: 0 25px 65px rgb(3 34 22 / 18%), inset 0 1px 0 rgb(255 255 255 / 12%);
  backdrop-filter: blur(12px);
}

.story-card-top,
.goal-row,
.goal-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.story-card-top {
  color: #e5f3e9;
  font-size: 10px;
  font-weight: 600;
}

.story-card-top > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.story-card-icon {
  display: inline-grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 8px;
  background: rgb(210 240 220 / 15%);
  color: #c8f0d4;
  font-size: 12px;
  font-style: normal;
}

.story-menu {
  color: #b8d7c4;
  font-size: 18px;
  letter-spacing: 1px;
}

.goal-row {
  margin-top: 22px;
}

.goal-row > span {
  display: grid;
  gap: 3px;
}

.goal-row strong {
  color: #f8fcf9;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.3px;
}

.goal-row small,
.goal-caption {
  color: #bdd8c6;
  font-size: 9px;
}

.goal-row b {
  color: #d9f3df;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
}

.goal-track {
  height: 6px;
  margin-top: 15px;
  overflow: hidden;
  border-radius: 5px;
  background: rgb(230 247 235 / 18%);
}

.goal-track span {
  display: block;
  width: 68%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a4e0b4, #d4efbb);
  animation: goal-grow 900ms 250ms cubic-bezier(.2, .7, .25, 1) both;
}

.goal-caption {
  margin-top: 8px;
}

.story-chart {
  display: block;
  width: 100%;
  height: 77px;
  margin-top: 6px;
  overflow: visible;
}

.story-chart > path:first-child {
  fill: none;
  stroke: rgb(223 245 230 / 12%);
  stroke-width: 1;
}

.story-chart-area {
  fill: rgb(159 225 177 / 12%);
}

.story-chart-line {
  fill: none;
  stroke: #b8e6bd;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
  stroke-dasharray: 550;
  stroke-dashoffset: 550;
  animation: chart-draw 1.1s 220ms ease forwards;
}

.story-chart circle {
  fill: #dff4d6;
  stroke: #337e58;
  stroke-width: 3;
}

.story-sample {
  position: absolute;
  right: 13px;
  bottom: 11px;
  color: #b6d5c0;
  font-size: 8px;
}

.story-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
  color: #c7e3d1;
  font-size: 10px;
}

.story-spark {
  color: #bfe9b4;
  font-size: 18px;
}

.story-footer {
  position: absolute;
  right: clamp(42px, 6vw, 82px);
  bottom: 22px;
  left: clamp(42px, 6vw, 82px);
  margin: 0;
  color: #add0bb;
  font-size: 9px;
  letter-spacing: .2px;
}

.story-footer span {
  padding-inline: 5px;
  color: #d8eddc;
}

@keyframes auth-appear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes goal-grow {
  from { width: 0; }
  to { width: 68%; }
}

@keyframes chart-draw {
  to { stroke-dashoffset: 0; }
}

@media (max-width: 1050px) {
  .auth-layout {
    grid-template-columns: minmax(0, .95fr) minmax(380px, 1.05fr);
    gap: 44px;
  }

  .auth-story {
    padding: 45px;
  }

  .story-footer {
    right: 45px;
    left: 45px;
  }
}

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

  .auth-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
  }

  .auth-story {
    min-height: 0;
    order: -1;
    padding: 31px 34px 30px;
    border-radius: 20px;
  }

  .story-content {
    max-width: 520px;
  }

  .story-kicker {
    margin-bottom: 12px;
  }

  .story-content h2 {
    font-size: 34px;
    letter-spacing: -1.5px;
  }

  .story-copy {
    margin: 9px 0 20px;
    font-size: 12px;
  }

  .story-art {
    padding: 14px 17px 13px;
  }

  .goal-row {
    margin-top: 12px;
  }

  .story-chart {
    height: 52px;
  }

  .story-bottom,
  .story-footer,
  .story-glow,
  .auth-story::after {
    display: none;
  }

  .auth-form-side {
    padding: 28px 0 46px;
  }

  .auth-form-wrap {
    max-width: 460px;
  }
}

@media (max-width: 520px) {
  .auth-header,
  .auth-layout {
    width: calc(100% - 36px);
  }

  .auth-header {
    min-height: 68px;
  }

  .auth-header .brand {
    font-size: 17px;
  }

  .auth-header .brand-mark {
    width: 32px;
    height: 32px;
  }

  .auth-header-actions {
    gap: 13px;
  }

  .auth-header-actions .back-link {
    font-size: 10px;
  }

  .auth-header-actions .theme-toggle {
    width: 37px;
    min-height: 38px;
    justify-content: center;
  }

  .auth-header-actions .theme-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .auth-story {
    padding: 25px 23px 23px;
  }

  .story-content h2 {
    font-size: 30px;
  }

  .story-copy {
    margin-bottom: 16px;
  }

  .story-art {
    padding: 13px 14px;
  }

  .goal-row strong {
    font-size: 14px;
  }

  .goal-row b {
    font-size: 20px;
  }

  .auth-form-side {
    padding: 24px 0 35px;
  }

  .auth-eyebrow {
    margin-bottom: 12px;
    font-size: 9px;
  }

  .auth-form-wrap h1 {
    font-size: 34px;
  }

  .auth-intro {
    margin-top: 8px;
    font-size: 12px;
  }

  .auth-form {
    gap: 15px;
  }

  .auth-field input {
    min-height: 47px;
  }

  .auth-footnote {
    font-size: 9px;
  }
}

@media (max-width: 360px) {
  .auth-header-actions .back-link {
    display: none;
  }

  .auth-header {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-form-wrap,
  .auth-form,
  .story-content,
  .goal-track span,
  .story-chart-line {
    animation: none;
  }
}
