/* ============================================================
   Aero. Auth Pages — modern dark "flight-sim" theme
   Shared by login.php & register.php (via $page_css)
   ============================================================ */

/* Dark ambient backdrop with starry glow (matches landing page) */
body.auth-body {
  background:
    radial-gradient(1100px 600px at 82% -10%, rgba(45,140,255,.22), transparent 60%),
    radial-gradient(900px 500px at 8% 110%, rgba(20,180,120,.14), transparent 60%),
    linear-gradient(160deg, #070b16 0%, #0d1526 55%, #0a1224 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: #e6ecf7;
}

/* faint static starfield */
body.auth-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 22px 30px, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 120px 90px, rgba(255,255,255,.4), transparent),
    radial-gradient(1.5px 1.5px at 200px 50px, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 300px 140px, rgba(255,255,255,.35), transparent),
    radial-gradient(2px 2px at 60px 200px, rgba(255,255,255,.28), transparent);
  background-size: 340px 300px;
  opacity: .5;
  pointer-events: none;
  z-index: 0;
}

/* The auth card */
.auth-container {
  position: relative;
  z-index: 1;
  max-width: 430px;
  margin: 4rem auto 5rem;
  padding: 2.6rem 2.4rem 2.2rem;
  background: linear-gradient(180deg, rgba(26,31,46,.82), rgba(16,20,32,.9));
  border: 1px solid rgba(120,150,200,.18);
  border-radius: 22px;
  box-shadow:
    0 30px 60px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
}

/* Brand emblem */
.auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  margin: 0 auto 1.1rem;
  font-size: 1.7rem;
  color: #04121f;
  background: linear-gradient(145deg, #4db0ff, #007aff);
  box-shadow: 0 10px 26px rgba(0,122,255,.45), 0 0 0 1px rgba(255,255,255,.08) inset;
}
.auth-brand i { filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }

.auth-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.01em;
  margin: 0 0 .25rem;
}

.auth-sub {
  font-size: .92rem;
  color: #93a0b8;
  margin: 0 0 1.6rem;
  line-height: 1.5;
}
.auth-sub strong { color: #cfe3ff; font-weight: 600; }

/* Message area (kept: JS sets textContent + className on #message-area) */
#message-area.message {
  padding: .85rem 1rem;
  margin: 0 0 1.2rem;
  border-radius: 12px;
  font-size: .88rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid transparent;
}
#message-area.message.success {
  color: #7df0a3;
  background: rgba(52,199,89,.12);
  border-color: rgba(52,199,89,.35);
}
#message-area.message.error {
  color: #ff9a92;
  background: rgba(255,59,48,.12);
  border-color: rgba(255,59,48,.35);
}

/* Form groups */
.auth-form { text-align: left; }

.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}
.form-group label {
  display: block;
  margin-bottom: .5rem;
  font-size: .82rem;
  font-weight: 600;
  color: #aab6cb;
  letter-spacing: .02em;
}

/* Input wrapper for leading icon */
.input-wrap {
  position: relative;
}
.input-wrap > i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7890;
  font-size: .95rem;
  pointer-events: none;
  transition: color .2s;
}
.input-wrap:focus-within > i { color: #4db0ff; }

.form-group input {
  width: 100%;
  padding: .95rem 1.1rem .95rem 2.7rem;
  background: rgba(10,14,26,.6);
  border: 1px solid rgba(130,160,210,.16);
  border-radius: 13px;
  font-size: 1rem;
  color: #eef3fc;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-group input::placeholder { color: #56617a; }
.form-group input:focus {
  outline: none;
  border-color: #4db0ff;
  background: rgba(12,18,34,.75);
  box-shadow: 0 0 0 3px rgba(0,122,255,.18);
}
/* OTP code — center large characters */
#otp {
  text-align: center;
  font-size: 1.7rem;
  letter-spacing: .55em;
  font-weight: 800;
  padding-left: 1.1rem;
  font-variant-numeric: tabular-nums;
}

/* Primary action button (kept text exact so register.js resets work) */
.btn-primary {
  width: 100%;
  padding: 1rem;
  margin-top: .35rem;
  background-image: linear-gradient(135deg, #3fa9ff, #007aff);
  color: #fff;
  border: none;
  border-radius: 13px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, filter .18s;
  box-shadow: 0 10px 24px rgba(0,122,255,.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,122,255,.46);
  filter: brightness(1.05);
}
.btn-primary:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Switch login <-> register */
.auth-switch {
  margin-top: 1.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(130,160,210,.12);
  font-size: .9rem;
  color: #8b97ae;
}
.auth-switch a {
  color: #4db0ff;
  font-weight: 700;
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

/* Resend OTP link */
#resend-otp-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: .85rem;
  color: #4db0ff;
  text-decoration: none;
  font-weight: 600;
}
#resend-otp-link:hover { text-decoration: underline; }

/* Hint text under a field (e.g. password strength hint) */
.form-hint {
  margin: .45rem 0 0;
  font-size: .76rem;
  color: #7d8aa3;
  line-height: 1.4;
}

/* Step transitions slide */
.auth-step {
  animation: authStepIn .35s ease;
}
@keyframes authStepIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Invalid email hint (UX) ---- */
.form-group input.is-invalid {
  border-color: #ff5b4d;
  box-shadow: 0 0 0 3px rgba(255,59,48,.18);
  background: rgba(40,10,12,.55);
}
.form-group input.is-invalid + *,
.input-wrap:has(input.is-invalid) > i { color: #ff5b4d; }

/* ---- Success popup (after create account) ---- */
.auth-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(4,7,14,.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.auth-popup-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.auth-popup {
  width: 100%;
  max-width: 320px;
  padding: 2.2rem 1.8rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(30,37,54,.96), rgba(18,23,38,.97));
  border: 1px solid rgba(120,200,255,.25);
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.05) inset;
  transform: scale(.9);
  transition: transform .3s ease;
}
.auth-popup-overlay.visible .auth-popup { transform: scale(1); }
.auth-popup-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  font-size: 2.1rem;
  color: #04121f;
  background: linear-gradient(145deg, #7df0a3, #1fbf6a);
  box-shadow: 0 12px 30px rgba(31,191,106,.45);
  animation: popSuccess .5s ease;
}
@keyframes popSuccess {
  0% { transform: scale(.4); opacity: 0; }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}
.auth-popup-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 .35rem;
}
.auth-popup-text {
  font-size: 1rem;
  color: #cfe3ff;
  margin: 0 0 1.2rem;
}
.auth-popup-sub {
  font-size: .78rem;
  color: #7d8aa3;
  margin: 0;
  letter-spacing: .03em;
}

/* Keep the auth container inside the normal doc layout but ensure the
   dark backdrop covers the whole area around the card. */
.auth-body .main-content {
  max-width: 100%;
  padding: 0 1.25rem;
}
.auth-body .site-header {
  background: rgba(7,11,22,.6);
  border-bottom: 1px solid rgba(130,160,210,.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.auth-body .site-footer {
  background: transparent;
  border-top: 1px solid rgba(130,160,210,.1);
}
.auth-body .site-footer,
.auth-body .site-footer a,
.auth-body .footer-bottom { color: #7d8aa3; }
.auth-body .site-footer h4 { color: #c6d2e8; }

/* Mobile niceties */
@media (max-width: 480px) {
  .auth-container {
    margin: 2.2rem auto 3rem;
    padding: 2rem 1.4rem 1.7rem;
  }
}
