/* ═══════════════════════════════════════
   SIGN IN — page-specific styles
   Built on top of css/styles.css (theme vars, navbar, footer, page-hero
   are all inherited from there). Everything below is scoped to the
   .signin-page body / .auth-* classes so it can't leak onto other pages.
═══════════════════════════════════════ */

.auth-main {
  display: flex;
  justify-content: center;
  padding: 12px 20px 72px;
}

/* ═══════ Card ═══════ */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(20, 29, 66, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top: 4px solid var(--coral);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.auth-card-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 1.5rem;
  text-align: center;
  color: var(--white);
  -webkit-text-stroke: 1px rgba(0, 0, 0, 0.18);
  paint-order: stroke fill;
  text-shadow: 2px 3px 0 rgba(0, 0, 0, 0.25);
  letter-spacing: 0.03em;
}

.auth-card-sub {
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

/* ═══════ Form ═══════ */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-field label {
  font-family: 'Luckiest Guy', cursive;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.02em;
}

.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-family: 'Fira Sans Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-field input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.auth-field input:focus {
  border-color: var(--white);
  box-shadow: 0 0 0 3px rgba(235, 66, 41, 0.3);
}

.auth-field input:disabled {
  opacity: 0.6;
}

/* Autofill (Chrome) keeps our dark theme instead of flashing white */
.auth-field input:-webkit-autofill {
  -webkit-text-fill-color: var(--white);
  -webkit-box-shadow: 0 0 0px 1000px rgba(30, 40, 80, 0.9) inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* ═══════ Links / secondary actions ═══════ */
.auth-links-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.auth-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Fira Sans Condensed', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.auth-link-btn:hover {
  color: var(--white);
}

.auth-resend-btn {
  align-self: center;
  margin-top: 2px;
}

.auth-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Fira Sans Condensed', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-back-btn:hover {
  color: var(--white);
}

.auth-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
}

.auth-switch a {
  color: var(--white);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ═══════ Submit button ═══════ */
.auth-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  margin-top: 4px;
  background: var(--coral);
  color: var(--white);
  font-family: 'Luckiest Guy', cursive;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-submit-btn:hover:not(:disabled) {
  background: var(--coral-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.auth-btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

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

/* ═══════ Status messages ═══════ */
.auth-message {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.auth-message--error {
  background: rgba(235, 66, 41, 0.18);
  border: 1px solid rgba(235, 66, 41, 0.5);
  color: #ffd4cc;
}

.auth-message--success {
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.45);
  color: #bdf2d3;
}

/* ═══════ View switching ═══════ */
.is-hidden {
  display: none !important;
}

/* ═══════ Toast (mirrors level.html's #levelToast) ═══════ */
.auth-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 12px);
  background: rgba(20, 29, 66, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-family: 'Fira Sans Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 500;
  max-width: 90vw;
  text-align: center;
}

.auth-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ═══════ Responsive ═══════ */
@media (max-width: 520px) {
  .auth-card {
    padding: 26px 20px;
    border-radius: 16px;
  }

  .auth-card-title {
    font-size: 1.3rem;
  }
}
