.login-page {
  min-height: 100vh;
  justify-content: flex-start;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 20%, var(--shadow-glow-accent), transparent 30rem),
    radial-gradient(circle at 92% 72%, var(--shadow-accent-soft), transparent 28rem),
    var(--bg-color);
}

.login-page site-header {
  position: relative;
  z-index: 10;
}

.auth-shell {
  display: grid;
  place-items: center;
  width: 100%;
  flex: 1;
  padding: clamp(32px, 5vw, 72px) 24px 80px;
}

.auth-card {
  display: block;
  width: min(100%, 560px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 28px;
  background: var(--card);
  box-shadow:
    0 35px 90px rgba(15, 23, 42, 0.14),
    0 2px 8px rgba(15, 23, 42, 0.05);
}

.auth-story {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(42px, 5vw, 64px);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent-dark) 88%, #06111f), color-mix(in srgb, var(--success) 82%, #07110c));
  color: #fff;
}

.auth-story::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom right, black, transparent 75%);
}

.auth-story__glow {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(4px);
  opacity: 0.3;
}

.auth-story__glow--one {
  top: -110px;
  right: -100px;
  width: 330px;
  height: 330px;
  background: var(--accent-light);
}

.auth-story__glow--two {
  bottom: -150px;
  left: -100px;
  width: 360px;
  height: 360px;
  background: var(--success-light);
}

.auth-story__content {
  position: relative;
  z-index: 1;
}

.auth-story__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 34px;
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.auth-story__eyebrow span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.12);
}

.auth-story h2 {
  max-width: 390px;
  margin: 0 0 20px;
  font-size: clamp(2.25rem, 4vw, 3.65rem);
  line-height: 1.03;
  letter-spacing: -0.045em;
  color: #fff;
}

.auth-story p {
  max-width: 380px;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
}

.progress-preview {
  position: relative;
  z-index: 1;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(14px);
}

.progress-preview__top,
.progress-preview__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.progress-preview__top {
  margin-bottom: 14px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.76);
}

.progress-preview__top strong {
  font-size: 1rem;
  color: #fff;
}

.progress-preview__track {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}

.progress-preview__track span {
  display: block;
  width: 72%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fff, color-mix(in srgb, var(--success-light) 45%, #fff));
}

.progress-preview__meta {
  margin-top: 13px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.58);
}

.progress-preview__meta i {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-right: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.65rem;
  font-style: normal;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(42px, 6vw, 72px);
}

.auth-panel__heading {
  margin-bottom: 30px;
}

.auth-kicker {
  display: block;
  margin-bottom: 12px;
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-panel h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-transform: none;
}

.auth-panel__heading p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.google-button,
.email-button {
  position: relative;
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 48px;
  border-radius: 12px;
  font: inherit;
  font-weight: 650;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

.google-button {
  border: 1px solid var(--border-input);
  background: var(--input-bg);
  color: var(--fg);
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.05);
}

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

.button-arrow {
  position: absolute;
  right: 20px;
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.google-button:hover,
.email-button:hover {
  transform: translateY(-2px);
}

.google-button:hover {
  border-color: var(--border-accent);
  box-shadow: 0 12px 28px var(--shadow-accent-soft);
}

.google-button:hover .button-arrow,
.email-button:hover .button-arrow {
  transform: translateX(3px);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 25px 0 22px;
  color: var(--muted);
  font-size: 0.78rem;
}

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

.form-field + .form-field {
  margin-top: 17px;
}

.form-field label {
  margin: 0 0 8px;
  color: var(--fg);
  font-size: 0.84rem;
  font-weight: 600;
  text-transform: none;
}

.form-field input {
  min-height: 52px;
  padding: 13px 15px;
  border-radius: 11px;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input::placeholder {
  color: var(--muted);
  opacity: 0.64;
}

.form-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--shadow-accent-soft);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  transform: translateY(-50%);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.password-toggle:hover {
  color: var(--fg);
  background: var(--card-bg);
}

.password-toggle svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle .eye-closed,
.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

.auth-message {
  display: none;
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, #dc2626 28%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, #dc2626 8%, transparent);
  color: light-dark(#b91c1c, #fca5a5);
  font-size: 0.82rem;
  line-height: 1.45;
}

.auth-message.is-visible {
  display: block;
}

.auth-message[data-tone="success"] {
  border-color: color-mix(in srgb, var(--success) 32%, transparent);
  background: color-mix(in srgb, var(--success) 9%, transparent);
  color: var(--success);
}

.forgot-password {
  display: block;
  margin: 14px auto 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 0.88rem;
  cursor: pointer;
}

.forgot-password:hover {
  text-decoration: underline;
}

.email-button {
  margin-top: 21px;
  border: 0;
  background: linear-gradient(135deg, var(--progress-start), var(--progress-end));
  color: #fff;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--success) 22%, transparent);
}

.email-button:hover {
  filter: brightness(1.06);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--success) 30%, transparent);
}

.google-button:focus-visible,
.email-button:focus-visible,
.password-toggle:focus-visible,
.forgot-password:focus-visible,
.auth-panel a:focus-visible {
  outline: 3px solid var(--shadow-hover-accent);
  outline-offset: 3px;
}

.google-button:disabled,
.email-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.is-loading::after {
  content: "";
  position: absolute;
  right: 19px;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

.is-loading .button-arrow {
  display: none;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

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

.auth-switch a,
.auth-terms a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover,
.auth-terms a:hover {
  text-decoration: underline;
}

.auth-terms {
  margin: 16px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.login-page .site-footer {
  width: 100%;
  margin-top: 0;
}

@media (max-width: 860px) {
  .auth-card {
    grid-template-columns: 1fr;
    width: min(100%, 560px);
  }

  .auth-story {
    min-height: 250px;
    padding: 38px;
  }

  .auth-story h2 {
    max-width: 430px;
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .auth-story p {
    display: none;
  }

  .auth-story__eyebrow {
    margin-bottom: 22px;
  }

  .progress-preview {
    display: none;
  }
}

@media (max-width: 540px) {
  .auth-shell {
    display: block;
    padding: 18px 14px 48px;
  }

  .auth-card {
    min-height: 0;
    border-radius: 21px;
  }

  .auth-story {
    min-height: 210px;
    padding: 30px 26px;
  }

  .auth-panel {
    padding: 34px 24px 38px;
  }

  .auth-panel__heading {
    margin-bottom: 26px;
  }

  .auth-panel h1 {
    font-size: 2rem;
  }

  .google-button,
  .email-button {
    padding-right: 42px;
    padding-left: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .google-button,
  .email-button,
  .button-arrow {
    transition: none;
  }

  .is-loading::after {
    animation-duration: 1.4s;
  }
}
