/**
 * Sen Computer — sign in / sign up page
 * Consumes the existing style-prefix.css custom properties directly
 * (--salmon-pink, --eerie-black, --cultured, etc.) — no new palette introduced.
 */

.auth-body {
  --auth-coral: #ff6847;
  --auth-coral-dark: #e04a29;
  --auth-coral-soft: #ffe2d9;
  --auth-cyan: #30c5d8;
  --auth-yellow: #ffd84d;
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #fffefb;
}

.auth-body::before,
.auth-body::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  pointer-events: none;
}

.auth-body::before { top: -140px; left: -120px; background: var(--auth-coral); }
.auth-body::after { bottom: -160px; right: -140px; background: var(--auth-cyan); opacity: 0.22; }

.auth-topbar,
.auth-main { position: relative; z-index: 1; }

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(16px, 5vw, 40px);
}

.auth-topbar .header-logo img { display: block; }

.auth-back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-7);
  font-weight: var(--weight-500);
  color: var(--sonic-silver-aa);
  transition: color 200ms ease-out;
}

.auth-back-link:hover,
.auth-back-link:focus-visible { color: var(--eerie-black); }

.auth-back-link .sc-icon { font-size: 18px; }

.auth-main {
  display: flex;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px) 16px 80px;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.04), 0 24px 50px -12px hsla(0, 0%, 0%, 0.16);
  padding: clamp(24px, 5vw, 40px);
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--auth-coral), var(--auth-cyan));
}

.auth-heading { text-align: center; margin-bottom: 24px; }

.auth-heading h1 {
  font-size: var(--fs-2);
  font-weight: var(--weight-600);
  color: var(--eerie-black);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.auth-heading p {
  font-size: var(--fs-7);
  color: var(--sonic-silver-aa);
}

/* Google button */

.auth-google-mount { min-height: 44px; margin-bottom: 18px; }

.auth-google-fallback-note {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--cultured);
  border-radius: 999px;
  background: var(--cultured);
  color: var(--sonic-silver-aa);
  margin-bottom: 18px;
}

.auth-google-fallback-note.is-visible { display: flex; }

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

.auth-google-fallback-note span:first-of-type {
  flex: 1;
  font-size: var(--fs-7);
  font-weight: var(--weight-500);
  text-align: left;
}

.auth-soon-badge {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--auth-coral-soft);
  color: var(--auth-coral-dark);
  font-size: var(--fs-9);
  font-weight: var(--weight-600);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--spanish-gray);
  font-size: var(--fs-8);
}

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

/* Tabs */

.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--cultured);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  width: calc(50% - 4px);
  background: var(--white);
  border-radius: 9px;
  box-shadow: 0 1px 3px hsla(0, 0%, 0%, 0.1);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-tab {
  position: relative;
  z-index: 1;
  padding: 10px 12px;
  font-size: var(--fs-7);
  font-weight: var(--weight-500);
  color: var(--sonic-silver-aa);
  text-align: center;
  border-radius: 9px;
  transition: color 200ms ease-out;
}

.auth-tab[aria-selected="true"] { color: var(--eerie-black); }

.auth-tab:active { transform: scale(0.98); }

/* Panels: grid-stacked so height doesn't jump on cross-fade */

.auth-panels {
  display: grid;
}

.auth-panel {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 260ms ease-out, transform 260ms ease-out;
}

.auth-panel.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Signup stepper */

.auth-stepper { margin-bottom: 20px; }

.auth-stepper-track {
  position: relative;
  height: 3px;
  background: var(--cultured);
  border-radius: 999px;
  margin-bottom: 12px;
  overflow: hidden;
}

.auth-stepper-fill {
  position: absolute;
  inset: 0 50% 0 0;
  background: var(--auth-coral);
  border-radius: 999px;
  transition: right 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-stepper[data-step="2"] .auth-stepper-fill { right: 0; }

.auth-stepper-labels {
  display: flex;
  justify-content: space-between;
  list-style: none;
}

.auth-stepper-labels li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-9);
  color: var(--sonic-silver-aa);
  transition: color 200ms ease-out;
}

.auth-stepper-labels li.is-current { color: var(--eerie-black); font-weight: var(--weight-600); }

.auth-stepper-dot {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cultured);
  color: var(--sonic-silver-aa);
  font-size: 10px;
  font-weight: var(--weight-700);
  transition: background 200ms ease-out, color 200ms ease-out;
}

.auth-stepper-labels li.is-current .auth-stepper-dot,
.auth-stepper-labels li.is-done .auth-stepper-dot { background: var(--auth-coral); color: var(--eerie-black); }

.auth-steps { display: grid; }

.auth-steps fieldset {
  grid-area: 1 / 1;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 240ms ease-out, transform 240ms ease-out;
}

.auth-steps fieldset.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.auth-step-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

.auth-step-back {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 13px 6px;
  color: var(--sonic-silver-aa);
  font-size: var(--fs-8);
  font-weight: var(--weight-600);
  transition: color 200ms ease-out;
}

.auth-step-back:hover,
.auth-step-back:focus-visible { color: var(--eerie-black); }
.auth-step-back .sc-icon { font-size: 16px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .auth-stepper-fill,
  .auth-steps fieldset { transition-duration: 1ms; }
}

/* Sign-in <-> forgot-password sub-toggle, nested inside the sign-in panel */

.auth-subpanels { display: grid; }

.auth-subpanels > div {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 220ms ease-out, transform 220ms ease-out;
}

.auth-subpanels > div.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.auth-field { margin-bottom: 16px; }

.auth-field label {
  display: block;
  font-size: var(--fs-8);
  font-weight: var(--weight-500);
  color: var(--onyx);
  margin-bottom: 6px;
}

.auth-field input {
  width: 100%;
  font: inherit;
  font-size: var(--fs-7);
  color: var(--eerie-black);
  padding: 12px 14px;
  border: 1px solid var(--cultured);
  border-radius: 10px;
  background: var(--white);
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.auth-field input:focus-visible {
  outline: none;
  border-color: var(--auth-coral);
  box-shadow: 0 0 0 4px hsla(14, 100%, 62%, 0.16);
}

.auth-field-error {
  font-size: var(--fs-8);
  color: var(--bittersweet);
  margin-top: 6px;
  min-height: 16px;
}

.auth-forgot-link {
  display: block;
  text-align: right;
  font-size: var(--fs-8);
  color: var(--sonic-silver-aa);
  margin: -8px 0 16px;
  transition: color 200ms ease-out;
}

.auth-forgot-link:hover,
.auth-forgot-link:focus-visible { color: var(--eerie-black); }

.auth-submit {
  position: relative;
  width: 100%;
  font-size: var(--fs-6);
  font-weight: var(--weight-600);
  color: var(--eerie-black);
  background: var(--auth-coral);
  padding: 13px;
  border-radius: 10px;
  box-shadow: 0 10px 20px hsla(14, 100%, 55%, 0.22);
  transition: transform 160ms ease-out, box-shadow 160ms ease-out, opacity 200ms ease-out;
}

.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 26px hsla(14, 100%, 55%, 0.28); }
.auth-submit:active { transform: scale(0.98); }
.auth-submit .auth-spinner { border-color: hsla(0, 0%, 0%, 0.18); border-top-color: var(--eerie-black); }

.auth-submit:disabled { opacity: 0.7; cursor: default; }

.auth-submit .auth-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid hsla(0, 100%, 100%, 0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  margin: 0 auto;
  animation: auth-spin 700ms linear infinite;
}

.auth-submit.is-loading .auth-label { display: none; }
.auth-submit.is-loading .auth-spinner { display: block; }

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

.auth-switch-prompt {
  text-align: center;
  font-size: var(--fs-8);
  color: var(--sonic-silver-aa);
  margin-top: 18px;
}

.auth-switch-prompt button {
  color: var(--eerie-black);
  font-weight: var(--weight-600);
  text-decoration: underline;
}

.auth-alert {
  font-size: var(--fs-8);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 220ms ease-out, max-height 220ms ease-out, margin 220ms ease-out, padding 220ms ease-out;
}

.auth-alert.is-visible {
  opacity: 1;
  max-height: 80px;
  margin-bottom: 16px;
}

.auth-alert.is-error { background: hsla(0, 100%, 70%, 0.12); color: #c02626; }
.auth-alert.is-success { background: hsla(152, 51%, 52%, 0.14); color: #1f7a52; }

@media (prefers-reduced-motion: reduce) {
  .auth-tab-indicator,
  .auth-panel,
  .auth-submit,
  .auth-alert { transition-duration: 1ms; }
}

/* Responsive: compact the card and decorative blobs so the whole form is
   comfortably reachable without needing to zoom out, from small phones up
   through short/laptop-height windows. */

@media (max-width: 900px) {
  .auth-body::before, .auth-body::after { width: 320px; height: 320px; }
}

@media (max-width: 600px), (max-height: 760px) {
  .auth-topbar { padding: 14px 16px; }
  .auth-main { padding: 8px 12px 32px; }
  .auth-card { border-radius: 16px; padding: 18px; }
  .auth-heading { margin-bottom: 16px; }
  .auth-heading h1 { font-size: var(--fs-3); }
  .auth-heading p { font-size: var(--fs-9); }
  .auth-google-mount, .auth-google-fallback-note { min-height: 38px; margin-bottom: 12px; }
  .auth-divider { margin-bottom: 14px; }
  .auth-tabs { margin-bottom: 16px; }
  .auth-field { margin-bottom: 11px; }
  .auth-field input { padding: 9px 12px; }
  .auth-submit { padding: 10px; }
  .auth-stepper { margin-bottom: 14px; }
}

@media (max-width: 380px) {
  .auth-body::before, .auth-body::after { width: 220px; height: 220px; }
}
