/* ===== RESET ===== */
:root {
  --h1: 4rem;
  --h2: 3.2rem;
  --h3: 2.4rem;
  --h4: 2rem;
  --h5: 1.8rem;
  --h6: 1.6rem;
  --hero-bg: var(--neutral-50);
  --hero-text-color: var(--brand-navy-700, var(--brand-navy-700));
  --hero-btn-hover: var(--brand-orange-500, var(--brand-orange-500));
}

* {
  font-family: "Poppins", sans-serif;
}

/* NOTE: body centering/overflow lives in general-creed.css only. Re-declaring
   body here used to override its mobile scroll fallbacks with overflow:hidden,
   clipping tall cards on phones. Don't re-add it. */

/* ===== Animated Floating Orbs ===== */
.orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.4;
  filter: blur(60px);
  animation: float 10s infinite ease-in-out;
}
.orb1 {
  width: 300px;
  height: 300px;
  background: #ff8a00;
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}
.orb2 {
  width: 400px;
  height: 400px;
  background: #e52e71;
  bottom: -150px;
  right: -150px;
  animation-delay: 3s;
}
.orb3 {
  width: 250px;
  height: 250px;
  background: #00c6ff;
  top: 50%;
  left: 60%;
  animation-delay: 6s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-30px) translateX(20px);
  }
}

/* ===== Login Card ===== */
.login-card {
  width: 34rem;
  padding: 2rem 2.2rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  z-index: 10;
  position: relative;
  animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Brand chip (logo + heading) */
.brand-chip {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.6rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid rgba(11, 60, 93, 0.12);
}

.brand-chip img {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(11, 60, 93, 0.25);
  flex-shrink: 0;
}

.login-card .brand-chip-text h2 {
  margin-bottom: 0.2rem;
  text-align: left;
  font-size: 1.9rem;
  line-height: 1.2;
}

.login-card .brand-chip-text p {
  margin-bottom: 0;
  text-align: left;
  font-size: 1.2rem;
  line-height: 1.45;
  opacity: 0.85;
}

.form-group {
  position: relative;
  margin-bottom: 1rem;
}

.form-group input {
  width: 100%;
  height: 4rem;
  padding: 0.5rem 1rem 0.5rem 4.2rem;
  border: 2px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: black;
  font-size: 1.4rem;
  transition: all 0.3s ease;
}

.form-group input::placeholder {
  color: rgba(11, 60, 93, 0.5);
}

.form-group input:focus {
  background: var(--white);
  outline: none;
  border-color: #ff8011;
  box-shadow: 0 0 0 4px rgba(255, 128, 17, 0.16), 0 6px 16px rgba(11, 60, 93, 0.1);
}

.form-group.has-error input {
  border-color: #e74c3c;
  box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.12);
}

/* Input leading icon */
.input-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(11, 60, 93, 0.55);
  pointer-events: none;
  transition: color 0.3s ease;
}

.input-icon svg {
  width: 20px;
  height: 20px;
}

.form-group:focus-within .input-icon {
  color: #ff8011;
}

.login-btn {
  width: 100%;
  height: 4rem;
  padding: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  border: none;
  border-radius: 10px;
  /* Was orange -> hot pink with white text. That pairing cannot pass AA:
     var(--white) on #e52e71 is 4.23:1, below the 4.5:1 floor. Deep text on a warm
     orange ramp clears it with room to spare (7.3:1 at the darkest stop)
     and stays inside the navy/orange brand. */
  background: linear-gradient(135deg, var(--brand-orange-300, #ff9d2e), #ff7a3d);
  background-size: 160% 160%;
  color: #1a0d00;
  font-weight: 600;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 18px rgba(255, 122, 61, 0.35);
}

.login-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.login-btn:hover {
  background-position: 100% 50%;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(255, 122, 61, 0.5);
}

.login-btn:hover svg {
  transform: translateX(4px);
}

.login-btn:active {
  transform: translateY(-1px) scale(0.99);
}

.login-btn:focus-visible {
  outline: 2px solid var(--color-ring, var(--brand-orange-700));
  outline-offset: 3px;
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.extra-links {
  margin-top: 0.8rem;
  text-align: center;
}

.extra-links a {
  color: #ff8a00;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 700;
  transition: color 0.3s ease;
}

.extra-links a:hover {
  color: var(--hero-text-color);
}

/* ===== Email verification banner (shown when an account isn't verified) ===== */
.verify-banner {
  margin: 1.2rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: rgba(255, 128, 17, 0.1);
  border: 1px solid rgba(255, 128, 17, 0.4);
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.verify-banner p {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--hero-text-color);
}

.verify-banner a {
  color: #ff8011;
  font-weight: 700;
  font-size: 1.3rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.verify-banner a:hover {
  color: #e56600;
  text-decoration: underline;
}

/* ===== Email OTP code input ===== */
#verify-code {
  letter-spacing: 0.6rem;
  text-align: center;
  padding-left: 1rem;
  font-size: 1.9rem;
  font-weight: 600;
}

/* ============ RESPONSIVE ============ */

/* Small tablets / large phones — larger touch targets, no iOS auto-zoom
   (inputs must be ≥16px). Dark-theme inputs stay dark: theme.css's
   [data-theme] selectors out-rank these. */
@media (max-width: 768px) {
  .login-card {
    width: min(92vw, 380px);
    padding: 1.7rem 1.5rem 1.9rem;
    border-radius: 20px;
    box-shadow: 0 18px 44px rgba(2, 42, 70, 0.16);
  }

  .form-group input {
    height: 46px;
    font-size: 16px;
    border-radius: 12px;
    background: #f6f8fb;
    border: 1.5px solid var(--line);
  }

  .form-group input:focus {
    background: var(--white);
    border-color: #ff8011;
  }

  .login-btn {
    height: 48px;
    font-size: 16px;
    border-radius: 12px;
  }

  .login-btn:active {
    transform: scale(0.98);
  }

  .input-icon {
    left: 1.1rem;
  }

  .input-icon svg {
    width: 19px;
    height: 19px;
  }

  .oauth-btn {
    height: 46px;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  :root {
    --h1: 3rem;
    --h2: 2.6rem;
    --h3: 2rem;
    --h4: 1.8rem;
    --h5: 1.6rem;
    --h6: 1.4rem;
  }

  .login-card {
    width: min(94vw, 380px);
    padding: 1.6rem 1.4rem 1.8rem;
  }

  .brand-chip {
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
  }

  .brand-chip img {
    width: 46px;
    height: 46px;
  }

  .login-card .brand-chip-text p {
    font-size: 1.25rem;
  }

  .form-group {
    margin-bottom: 0.9rem;
  }

  .form-group input {
    padding-left: 3.8rem;
  }

  .input-icon {
    left: 1rem;
  }

  .form-row {
    margin-bottom: 0.8rem;
  }

  .remember-me {
    font-size: 0.95rem;
  }

  .extra-links {
    margin-top: 0.9rem;
  }

  .extra-links a {
    font-size: 1.35rem;
  }
}

@media (max-width: 340px) {
  .login-card {
    padding: 1.4rem 1rem;
  }
}

/* ===== Inline field feedback ===== */
.field-error {
  color: #e74c3c;
  font-size: 1.3rem;
  font-weight: 500;
  margin: 0.4rem 0 0;
  text-align: left;
  animation: fadeIn 0.3s ease;
}

.field-success {
  margin-top: 1.4rem;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.55);
  color: #1e8449;
  font-size: var(--h6);
  font-weight: 500;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

/* ===== Password visibility toggle ===== */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 4rem; /* room for the eye button */
}

.password-wrapper .toggle-password {
  position: absolute;
  top: 50%; /* vertically centred on the input (the wrapper contains only the input) */
  right: 0.6rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--hero-text-color);
  opacity: 0.7;
  border-radius: 8px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.password-wrapper .toggle-password:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.12);
}

.password-wrapper .toggle-password:focus-visible {
  outline: 2px solid var(--color-ring, var(--brand-orange-700));
  outline-offset: 2px;
}

.password-wrapper .toggle-password svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 480px) {
  .password-wrapper .toggle-password {
    top: 50%; /* stays centred automatically */
  }
}

/* ===== 2FA code input ===== */
#2fa-code,
#fp-2fa-code {
  letter-spacing: 0.6rem;
  text-align: center;
  padding-left: 1rem;
  font-size: 1.9rem;
  font-weight: 600;
}

/* ===== Remember me row ===== */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0.2rem 0 0.9rem;
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--blue-900, var(--brand-navy-700, var(--brand-navy-700)));
  user-select: none;
}

.remember-me input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #d9dee5;
  border-radius: 5px;
  background: var(--white);
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.remember-me input[type="checkbox"]:hover {
  border-color: #ff8011;
}

.remember-me input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--brand-orange-500, var(--brand-orange-500)), var(--brand-orange-400, var(--brand-orange-400)));
  border-color: var(--brand-orange-500, var(--brand-orange-500));
  box-shadow: 0 2px 8px rgba(255, 122, 0, 0.35);
}

.remember-me input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0px;
  width: 5px;
  height: 10px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.remember-me input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--color-ring, var(--brand-orange-700));
  outline-offset: 2px;
}

.forgot-link {
  color: #ff8011;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-link:hover {
  color: #e56600;
  text-decoration: underline;
}

/* --- Staff login page --- */
.staff-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 127, 17, 0.08);
  border: 1px solid rgba(255, 127, 17, 0.25);
  color: #5b4a33;
  font-size: 0.9rem;
  line-height: 1.5;
}

.staff-hint svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--brand-orange-500, var(--brand-orange-500));
}

[data-theme="dark"] .staff-hint {
  background: rgba(255, 127, 17, 0.1);
  color: #d9c6a8;
}

/* Staff badge chip on the login page */
.staff-login-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(11, 60, 93, 0.06);
  border: 1px solid rgba(11, 60, 93, 0.15);
  color: var(--brand-navy-700, var(--brand-navy-700));
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.staff-login-link:hover {
  background: var(--brand-navy-700, var(--brand-navy-700));
  color: var(--white);
  transform: translateY(-1px);
}

[data-theme="dark"] .staff-login-link {
  background: rgba(219, 230, 243, 0.06);
  border-color: rgba(219, 230, 243, 0.18);
  color: #dbe6f3;
}

[data-theme="dark"] .staff-login-link:hover {
  background: var(--brand-orange-500, var(--brand-orange-500));
  color: #1a0d00;
}

/* ===== Mobile performance: blur/backdrop filters are GPU-heavy on phones ===== */
@media (max-width: 768px) {
  .orb {
    animation: none;
    filter: blur(0);
    opacity: 0.45;
  }
  .login-card,
  .signup-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.88);
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .orb {
    animation: none;
    filter: blur(0);
  }
}

/* ---------- Consent page (updated Terms / Privacy) ---------- */
.consent-version {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(11, 60, 93, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 18px;
  font-size: 0.82rem;
  color: var(--brand-navy-700, var(--brand-navy-700));
  text-align: center;
}
[data-theme="dark"] .consent-version {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #dbe7f3;
}
.consent-group {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(11, 60, 93, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .consent-group {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}
.consent-group.has-error {
  border-color: #d9534f;
}
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.5;
  color: inherit;
}
.consent-label input[type="checkbox"] {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--brand-orange-500, var(--brand-orange-500));
  cursor: pointer;
  flex: 0 0 auto;
}
.consent-text a {
  color: #2575fc;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
[data-theme="dark"] .consent-text a {
  color: #7ab7ff;
}
.consent-note {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--brand-navy-700, var(--brand-navy-700));
  opacity: 0.85;
  text-align: center;
}
[data-theme="dark"] .consent-note {
  color: #dbe7f3;
}

/* ============ LIGHT-MODE POLISH ============ */
body {
  background:
    radial-gradient(900px 500px at 85% 110%, rgba(255, 138, 43, 0.08), transparent 60%),
    radial-gradient(800px 500px at 10% -10%, rgba(0, 198, 255, 0.07), transparent 60%),
    linear-gradient(160deg, var(--neutral-50) 0%, #eef3f9 100%);
}

.orb {
  opacity: 0.25;
}

.login-card {
  box-shadow: 0 18px 44px rgba(2, 42, 70, 0.14), 0 2px 8px rgba(2, 42, 70, 0.05);
}

/* ============ DARK-MODE COMPLETION ============ */
/* theme.css flips the card, headings and inputs; these cover everything it
   missed so no light leftover survives the switch. */
[data-theme="dark"] body {
  background:
    radial-gradient(900px 500px at 85% 110%, rgba(255, 138, 43, 0.1), transparent 60%),
    radial-gradient(800px 500px at 10% -10%, rgba(0, 150, 255, 0.08), transparent 60%),
    linear-gradient(160deg, #0a101d 0%, #0d1626 100%);
}

[data-theme="dark"] .orb {
  opacity: 0.16;
}

[data-theme="dark"] .login-card {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(13, 22, 38, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .input-icon {
  color: rgba(219, 230, 243, 0.55);
}

[data-theme="dark"] .remember-me {
  color: #c7d4e4;
}

[data-theme="dark"] .remember-me input[type="checkbox"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: #2a3854;
}

[data-theme="dark"] .forgot-link {
  color: #ff9e4d;
}

[data-theme="dark"] .verify-banner {
  background: rgba(255, 138, 43, 0.08);
  border-color: rgba(255, 138, 43, 0.3);
}

[data-theme="dark"] .verify-banner p {
  color: #ffd9ac;
}

[data-theme="dark"] .field-error {
  color: #ff8a8a;
}

[data-theme="dark"] .field-success {
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.35);
  color: #7ee2a8;
}

/* The mobile-performance override above forces a light card on phones;
   re-darken it when the theme is dark. */
@media (max-width: 768px) {
  [data-theme="dark"] .login-card,
  [data-theme="dark"] .signup-card {
    background: rgba(13, 22, 38, 0.94);
  }
}

/* Dark inputs on phones (matches the mobile sizes; keeps ≥16px font) */
@media (max-width: 768px) {
  [data-theme="dark"] .form-group input {
    background: rgba(255, 255, 255, 0.06);
    border-color: #2a3854;
    color: #eef4fb;
  }

  [data-theme="dark"] .form-group input:focus {
    background: #14203a;
    border-color: #ff8011;
  }

  [data-theme="dark"] .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
  }

  [data-theme="dark"] .input-icon {
    color: rgba(219, 230, 243, 0.5);
  }
}

/* OTP inputs: keep ≥16px on mobile so iOS doesn't zoom, and tighten the
   wide letter-spacing that overflows small screens. */
@media (max-width: 768px) {
  #verify-code,
  #2fa-code,
  #fp-2fa-code {
    font-size: 18px;
    letter-spacing: 0.35rem;
    padding-left: 0.8rem;
  }
}
