.auth-page {
  --auth-surface-panel: color-mix(in srgb, var(--surface-1) 92%, #000000 8%);
  --auth-border-strong: color-mix(in srgb, var(--border-on-dark) 78%, rgba(var(--primary-rgb), 0.38) 22%);
  --auth-copy-muted: color-mix(in srgb, var(--text-on-dark-muted) 88%, #ffffff 12%);
  min-height: calc(100vh - 76px);
  padding: 0;
  position: relative;
  overflow-x: clip;
}
section.auth-shell {
  padding: 40px;
}

.auth-page::before,
.auth-page::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.auth-page::before {
  inset: 0;
  background:
    radial-gradient(520px 360px at 12% 12%, rgba(var(--primary-rgb), 0.18), transparent 72%),
    radial-gradient(420px 290px at 88% 14%, rgba(var(--primary-rgb), 0.12), transparent 76%);
}

.auth-page::after {
  width: min(42vw, 520px);
  aspect-ratio: 1;
  right: -14%;
  bottom: -24%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.2) 0%, rgba(var(--primary-rgb), 0) 68%);
  filter: blur(10px);
}

/* Remove section card wrappers injected by shared public page styles. */
body.public-mood > main.auth-page > section.auth-shell,
body.public-mood main.auth-page > section.auth-shell {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

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

.auth-layout {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.8rem);
}

.auth-layout--single {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

.auth-layout--single .auth-panel {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.auth-panel {
  border-radius: 24px;
  border: 1px solid var(--auth-border-strong);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
  position: relative;
  overflow: hidden;
  padding: clamp(1.3rem, 2.6vw, 2rem);
  background:
    linear-gradient(160deg, rgba(var(--primary-rgb), 0.08), rgba(var(--primary-rgb), 0.03) 48%, transparent 100%),
    var(--auth-surface-panel);
}

.auth-panel::before {
  content: '';
  position: absolute;
  inset: auto auto 0 0;
  width: 100%;
  height: 44%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--primary-rgb), 0) 0%, rgba(var(--primary-rgb), 0.08) 100%);
}

.auth-home-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  color: var(--auth-copy-muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
}

.auth-home-link:hover,
.auth-home-link:focus-visible {
  color: var(--text-on-dark);
}

.auth-heading {
  margin-bottom: 1rem;
}

.auth-panel-badge {
  margin: 0;
  color: rgba(var(--primary-rgb), 0.95);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: clamp(1.9rem, 1.56rem + 0.7vw, 2.3rem) !important;
  line-height: 1.05;
  font-weight: 800;
}

.auth-subtitle {
  margin: 0.55rem 0 0;
  color: var(--auth-copy-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 32ch;
}

.auth-message-slot {
  min-height: 1px;
}

.auth-google-btn {
  min-height: 48px;
  border-radius: 12px;
  border-color: var(--auth-border-strong);
  color: var(--text-on-dark);
  background: rgba(var(--dark-base-1-rgb), 0.42);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.auth-google-btn:hover,
.auth-google-btn:focus-visible {
  border-color: rgba(var(--primary-rgb), 0.58);
  background: rgba(var(--primary-rgb), 0.16);
  color: var(--text-on-dark);
}

.auth-google-btn i {
  font-size: 1rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.68rem;
  margin-top: 0.92rem;
  color: var(--auth-copy-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
}

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

.auth-social-note {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--auth-copy-muted);
}

.auth-form {
  margin-top: 1rem;
}

.auth-form .form-label {
  color: var(--auth-copy-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  margin-bottom: 0.36rem;
}

.auth-form .form-control {
  min-height: 48px;
  border-radius: 12px;
  background: rgba(var(--dark-base-1-rgb), 0.42);
  border-color: var(--auth-border-strong);
  color: var(--text-on-dark);
}

.auth-form .form-control::placeholder {
  color: rgba(170, 180, 196, 0.78);
}

.auth-form .form-control:focus {
  border-color: rgba(var(--primary-rgb), 0.68);
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.18);
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .form-control {
  padding-right: 2.8rem;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.42rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--auth-copy-muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  color: var(--text-on-dark);
  background: rgba(var(--primary-rgb), 0.14);
  outline: none;
}

.auth-links-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.32rem;
  font-size: 0.86rem;
}

.auth-form .form-check-label {
  color: var(--auth-copy-muted);
}

.auth-form .form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.auth-links-inline a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
}

.auth-links-inline a:hover {
  color: var(--text-on-dark);
}

.auth-password-note {
  margin: -0.1rem 0 0.9rem;
  color: var(--auth-copy-muted);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.auth-submit-btn {
  min-height: 49px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary-color) 90%, #ffffff 10%),
    color-mix(in srgb, var(--primary-color) 72%, #7a1010 28%)
  );
  color: #fff;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.95rem;
  font-weight: 700;
}

.auth-submit-btn:hover,
.auth-submit-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(var(--primary-rgb), 0.3);
  color: #fff;
}

.auth-submit-btn[disabled] {
  opacity: 0.82;
  cursor: not-allowed;
}

.auth-links {
  margin-top: 0.98rem;
  color: var(--auth-copy-muted);
  text-align: center;
  font-size: 0.9rem;
}

.auth-links p {
  margin-bottom: 0;
}

.auth-links a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 700;
}

.auth-links a:hover {
  color: var(--text-on-dark);
}

:root[data-theme='light'] .auth-page {
  --auth-surface-panel: color-mix(in srgb, #fff9f7 92%, #f6ece8 8%);
  --auth-border-strong: rgba(126, 94, 83, 0.2);
  --auth-copy-muted: #6d5f59;
}

:root[data-theme='light'] .auth-panel {
  box-shadow: 0 20px 38px rgba(86, 61, 53, 0.16);
}

:root[data-theme='light'] .auth-google-btn,
:root[data-theme='light'] .auth-form .form-control {
  background: #fff;
  color: #2f2522;
}

:root[data-theme='light'] .auth-form .form-control::placeholder {
  color: rgba(109, 95, 89, 0.78);
}

@media (max-width: 991px) {
  section{
    padding: 0;
  }
  .auth-page {
    padding-top: 0px;
    padding-bottom: 48px;
  }

  .auth-layout--single {
    max-width: 560px;
    margin: 0 auto;
  }
}

@media (max-width: 575px) {
  .auth-page {
    padding: 0 !important;
    display: flex;
    align-items: center;
  }
  section{
    padding: 0 !important;
  }
  .auth-shell {
    width: 100%;
  }

  .auth-shell .container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - 84px);
  }

  .auth-layout--single {
    width: 100%;
    justify-items: center;
  }

  .auth-panel {
    border-radius: 18px;
    padding: 1rem;
  }

  .auth-home-link {
    margin-bottom: 0.84rem;
    font-size: 0.8rem;
  }

  .auth-links-inline {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 575px) and (max-height: 760px) {
  .auth-page {
    align-items: flex-start;
  }

  .auth-shell .container {
    min-height: auto;
    align-items: flex-start;
    padding-top: 0.5rem;
  }
}

@media (max-width: 390px) {
  .auth-panel-badge {
    font-size: clamp(1.72rem, 1.45rem + 0.7vw, 2rem) !important;
  }

  .auth-submit-btn {
    min-height: 47px;
    font-size: 0.9rem;
  }
}
