/* ==========================================================================
   Modaam Auth — shared styles for login / otp / otp-verify / register

   NOTE: selectors below are prefixed with `#auth` on purpose. The legacy
   `style.css` has old id-based rules (`#auth input[type=...] { border:0 }`,
   `#hero, #auth { background:url(hero-bg.jpg) }`, `#auth a { font-size:14px }`,
   `#auth button { ... }`) that otherwise win by specificity even though this
   file loads after it.
   ========================================================================== */

:root {
  --auth-bg-1: #1b120c;
  --auth-bg-2: #3a2418;
  --auth-gold: #d4af6a;
  --auth-gold-soft: rgba(212, 175, 106, 0.16);
  --auth-accent: #198754;
  --auth-accent-soft: rgba(25, 135, 84, 0.12);
  --auth-text-muted: #6b7280;
  --auth-border: #d7cabb;
  --auth-radius: 20px;
}

#auth.auth-shell {
  position: relative;
  min-height: 100vh;
  height: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  overflow: hidden;
  background:
    radial-gradient(55% 55% at 12% 8%, rgba(212, 175, 106, 0.22) 0%, rgba(212, 175, 106, 0) 60%),
    radial-gradient(50% 50% at 92% 92%, rgba(120, 72, 32, 0.35) 0%, rgba(120, 72, 32, 0) 60%),
    linear-gradient(160deg, var(--auth-bg-2) 0%, var(--auth-bg-1) 100%);
}

#auth .auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  background: #fffdfa;
  border-radius: var(--auth-radius);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--auth-gold-soft);
  padding: 40px 32px;
}

@media (max-width: 480px) {
  #auth .auth-card {
    padding: 28px 20px;
    border-radius: 16px;
  }
}

#auth .auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

#auth .auth-logo img {
  height: 44px;
  width: auto;
}

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

#auth .auth-heading h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

#auth .auth-heading p {
  font-size: 0.875rem;
  color: var(--auth-text-muted);
  margin-bottom: 0;
}

/* Segmented tab switcher (password login vs OTP login) */
#auth .auth-tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
}

#auth .auth-tabs a {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--auth-text-muted);
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

#auth .auth-tabs a.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

#auth .auth-tabs a:not(.active):hover {
  color: #111827;
}

/* Inputs with a leading icon, floating label */
#auth .auth-field {
  position: relative;
  margin-bottom: 16px;
}

#auth .auth-field .form-floating {
  position: relative;
}

#auth .auth-field .form-control {
  border: 1.5px solid var(--auth-border);
  background: #faf7f2;
  border-radius: 12px;
  padding-inline-start: 44px;
  min-height: 54px;
  font-size: 0.95rem;
  box-shadow: 0 1px 2px rgba(59, 40, 20, 0.05);
}

#auth .auth-field .form-control:hover {
  border-color: #c2b09a;
}

#auth .auth-field .form-control:focus {
  background: #ffffff;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 4px var(--auth-accent-soft);
}

#auth .auth-field .form-floating > label {
  right: auto;
  inset-inline-start: 44px;
  color: var(--auth-text-muted);
}

#auth .auth-field .field-icon {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 14px;
  display: flex;
  align-items: center;
  color: #9ca3af;
  font-size: 1.05rem;
  pointer-events: none;
  z-index: 5;
}

#auth .auth-field .form-control.is-invalid {
  border-color: #dc2626;
  background-image: none;
}

#auth .auth-field .invalid-feedback {
  font-size: 0.78rem;
  padding: 0;
}

/* Primary CTA */
#auth .btn-auth-primary {
  background: var(--auth-accent);
  border: none;
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
  padding: 12px 16px;
  min-height: 50px;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
  box-shadow: 0 10px 20px -8px rgba(25, 135, 84, 0.55);
}

#auth .btn-auth-primary:hover,
#auth .btn-auth-primary:focus {
  background: #157347;
  color: #fff;
}

#auth .btn-auth-primary:active {
  transform: translateY(1px);
}

#auth .btn-auth-primary[disabled] {
  opacity: 0.6;
  box-shadow: none;
  cursor: not-allowed;
}

#auth .btn-auth-secondary {
  background: #ffffff;
  border: 1px solid var(--auth-border);
  color: #374151;
  font-weight: 600;
  border-radius: 12px;
  padding: 12px 16px;
  min-height: 50px;
  transition: background-color 150ms ease, border-color 150ms ease;
}

#auth .btn-auth-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}

/* Remember-me row */
#auth .auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #374151;
}

#auth .auth-remember .form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  cursor: pointer;
}

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

#auth .auth-remember label {
  cursor: pointer;
  margin: 0;
  font-size: 0.85rem;
}

/* Footer links under the form */
#auth .auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 0.85rem;
  color: var(--auth-text-muted);
}

#auth .auth-footer a {
  color: var(--auth-accent);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
}

#auth .auth-footer a:hover {
  text-decoration: underline;
}

#auth .auth-back-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 0.8rem;
  color: #9ca3af;
  text-decoration: none;
}

#auth .auth-back-link:hover {
  color: #ffffff;
}

#auth .auth-alert {
  border-radius: 12px;
  font-size: 0.85rem;
  border: none;
  background: #fef2f2;
  color: #b91c1c;
  padding: 12px 14px;
  margin-bottom: 18px;
}

/* OTP boxes */
#auth .otp-boxes {
  display: flex;
  gap: 10px;
  justify-content: center;
  direction: ltr;
  margin-bottom: 18px;
}

#auth .otp-boxes input {
  width: 52px;
  height: 58px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  border: 1.5px solid var(--auth-border);
  background: #faf7f2;
  border-radius: 12px;
  color: #111827;
  box-shadow: 0 1px 2px rgba(59, 40, 20, 0.05);
  padding: 0;
}

#auth .otp-boxes input:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 4px var(--auth-accent-soft);
}

@media (max-width: 380px) {
  #auth .otp-boxes {
    gap: 6px;
  }
  #auth .otp-boxes input {
    width: 44px;
    height: 52px;
    font-size: 1.2rem;
  }
}

#auth .otp-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--auth-text-muted);
  margin-bottom: 18px;
}

#auth .otp-timer strong {
  color: #111827;
  font-variant-numeric: tabular-nums;
}

#auth .otp-resend-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--auth-accent);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

#auth .otp-resend-link:disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

/* Decorative background: rising coffee-steam particles */
#auth .auth-steam {
  position: absolute;
  bottom: -40px;
  z-index: 1;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(212, 175, 106, 0.5);
  filter: blur(1.5px);
  animation-name: authSteamRise;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
  pointer-events: none;
}

@keyframes authSteamRise {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  12% { opacity: 0.6; }
  85% { opacity: 0.25; }
  100% { transform: translateY(-105vh) translateX(24px) scale(0.35); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #auth .btn-auth-primary,
  #auth .auth-tabs a {
    transition: none;
  }

  #auth .auth-steam {
    animation: none;
  }
}
