/* ============================================================
   RL1.2 Auth Theme — dark-glass + gold glassmorphism
   Shared by login.html, register.html, driver-registration.html
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  position: relative;
  background: #0b0b0f;
  color: #ffffff;
}

/* ── Animated gradient background ── */
.bg-gradient {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0b0b0f 0%, #15140f 45%, #1a1305 75%, #0b0b0f 100%);
  z-index: 0;
}

/* Animated orbs (gold / orange) */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 8s ease-in-out infinite;
  z-index: 0;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #e2bc3d, transparent 70%);
  top: -150px; left: -100px;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #ff8c42, transparent 70%);
  bottom: -100px; right: -80px;
  animation-delay: -3s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #e2bc3d, transparent 70%);
  top: 50%; left: 60%;
  animation-delay: -5s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(30px, -40px) scale(1.05); }
  66%      { transform: translate(-20px, 20px) scale(0.95); }
}

/* Floating particles */
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  width: 3px; height: 3px;
  background: #e2bc3d;
  border-radius: 50%;
  opacity: 0;
  animation: particleRise linear infinite;
}
@keyframes particleRise {
  0%   { transform: translateY(100vh) translateX(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-10vh) translateX(60px); opacity: 0; }
}

/* ── Card (glassmorphism) ── */
.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  padding: 44px 40px;
  color: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  animation: cardIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Gold top border accent / shimmer */
.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e2bc3d, #ff8c42, #e2bc3d, transparent);
  border-radius: 0 0 4px 4px;
  animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 24px;
  transition: color 0.2s;
}
.back-link:hover { color: #e2bc3d; }
.back-link svg { width: 15px; height: 15px; }

/* Logo */
.card-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
  animation: fadeDown 0.6s ease 0.2s both;
}
.card-logo img {
  height: 44px;
  width: auto;
  transition: transform 0.3s;
}
.card-logo img:hover { transform: scale(1.05); }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Heading */
.card-title {
  text-align: center;
  font-size: 1.9rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  animation: fadeDown 0.6s ease 0.3s both;
}
.card-title span {
  background: linear-gradient(135deg, #e2bc3d, #ff8c42);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.card-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 26px;
  animation: fadeDown 0.6s ease 0.35s both;
}

/* ── Role switch (Rider / Driver) ── */
.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 22px;
  animation: fadeDown 0.6s ease 0.38s both;
}
.role-switch a,
.role-switch span,
.role-switch button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all .2s;
}
.role-switch .active {
  background: linear-gradient(135deg, #e2bc3d, #ff8c42);
  color: #1a1a1a;
}
.role-switch a:hover,
.role-switch button:hover { color: #fff; }
.role-switch button.active:hover { color: #1a1a1a; }
.role-switch svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Messages */
.error-message {
  background: rgba(224, 68, 79, 0.15);
  border: 1px solid rgba(224, 68, 79, 0.4);
  color: #ff8a8a;
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  display: none;
  font-size: 0.88rem;
}
.success-message {
  background: rgba(31, 184, 122, 0.15);
  border: 1px solid rgba(31, 184, 122, 0.4);
  color: #74e0a8;
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  display: none;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Admin helper (login page) */
.admin-helper {
  background: rgba(226, 188, 61, 0.08);
  border: 1px solid rgba(226, 188, 61, 0.3);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 14px;
  display: none;
}
.admin-helper-text { font-size: 0.8rem; color: rgba(255, 255, 255, 0.8); }
.admin-helper-text span { font-size: 0.73rem; color: rgba(255, 255, 255, 0.55); display: block; margin-top: 2px; }
.admin-fill-btn {
  background: #e2bc3d;
  color: #1a1a1a;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.admin-fill-btn:hover { background: #f5d97a; }

/* ── Form layout ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.full-width { grid-column: span 2; }

.form-group {
  margin-bottom: 18px;
  animation: fadeUp 0.5s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.input-wrap { position: relative; }
/* Direct child only — must NOT target the injected show/hide eye (.pw-toggle svg),
   which lives inside a button and would otherwise be mis-positioned/overflow. */
.input-wrap > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  stroke: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  transition: stroke 0.25s;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 13px 16px 13px 44px;
  font-size: 0.95rem;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  outline: none;
  transition: all 0.25s ease;
}
.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23ffffff' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}
.form-group input::placeholder { color: rgba(255, 255, 255, 0.5); }
.form-group input:focus,
.form-group select:focus {
  border-color: #e2bc3d;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 0 0 3px rgba(226, 188, 61, 0.18);
}
.form-group input:focus + svg,
.input-wrap:focus-within > svg { stroke: #e2bc3d; }

/* Chrome/Safari autofill paints inputs light — mask with a dark inset fill and
   force white text so autofilled fields stay on the dark theme. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #161616 inset !important;
  box-shadow: 0 0 0 1000px #161616 inset !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff !important;
  transition: background-color 9999s ease-in-out 0s;
}
.form-group select option {
  background: #1a1305;
  color: #ffffff;
}

/* Options (login) */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 8px;
  animation: fadeUp 0.5s ease 0.55s both;
}
.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  cursor: pointer;
}
.remember-me input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: #e2bc3d;
  cursor: pointer;
}
.forgot-password {
  color: #e2bc3d;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}
.forgot-password:hover { color: #f5d97a; }

/* Terms */
.terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  animation: fadeUp 0.5s ease 0.65s both;
  cursor: pointer;
}
.terms input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: #e2bc3d;
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}
.terms a { color: #e2bc3d; text-decoration: none; font-weight: 500; }
.terms a:hover { color: #f5d97a; }

/* ── Primary button (login / signup / register) ── */
.btn-login,
.btn-signup,
.btn-register {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #e2bc3d 0%, #ff8c42 100%);
  color: #1a1a1a;
  box-shadow: 0 4px 24px rgba(226, 188, 61, 0.4);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  animation: fadeUp 0.5s ease 0.6s both;
}
.btn-login::before,
.btn-signup::before,
.btn-register::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.5s ease;
}
.btn-login:hover::before,
.btn-signup:hover::before,
.btn-register:hover::before { left: 100%; }
.btn-login:hover,
.btn-signup:hover,
.btn-register:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(226, 188, 61, 0.55);
}
.btn-login:active,
.btn-signup:active,
.btn-register:active { transform: translateY(0); }
.btn-login:disabled,
.btn-signup:disabled,
.btn-register:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  animation: fadeUp 0.5s ease 0.65s both;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

/* Social buttons */
.social-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
  animation: fadeUp 0.5s ease 0.7s both;
}
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
}
.social-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: #e2bc3d;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(226, 188, 61, 0.2);
}
.social-btn svg { width: 22px; height: 22px; flex-shrink: 0; }

/* Signup / login link */
.signup-link,
.login-link {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  animation: fadeUp 0.5s ease 0.75s both;
}
.signup-link a,
.login-link a {
  color: #e2bc3d;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.signup-link a:hover,
.login-link a:hover { color: #f5d97a; }

/* Show / hide password toggle (injected by js/show-password.js) */
.pw-toggle { color: rgba(255, 255, 255, 0.6) !important; }
.pw-toggle:hover { color: #fff !important; }

/* ── Responsive ── */
@media (max-width: 600px) {
  body { padding: 16px; }
  .login-card {
    padding: 28px 20px;
    border-radius: 20px;
    max-width: 100%;
  }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .full-width { grid-column: span 1; }
  .card-title { font-size: 1.5rem; }
  .card-subtitle { font-size: 0.82rem; margin-bottom: 20px; }
  .card-logo img { height: 36px; }
  .back-link { font-size: 0.8rem; margin-bottom: 18px; }
  .form-group { margin-bottom: 14px; }
  .form-group label { font-size: 0.76rem; }
  .form-group input,
  .form-group select { padding: 11px 12px 11px 38px; font-size: 0.9rem; }
  .input-wrap svg { width: 15px; height: 15px; }
  .terms { font-size: 0.8rem; margin-bottom: 16px; }
  .btn-login,
  .btn-signup,
  .btn-register { padding: 13px; font-size: 0.95rem; }
  .social-buttons { grid-template-columns: 1fr; gap: 8px; }
  .social-btn { padding: 10px; font-size: 0.82rem; }
  .divider { font-size: 0.75rem; }
  .signup-link,
  .login-link { font-size: 0.85rem; }
  .form-options { flex-direction: column; align-items: flex-start; gap: 6px; }
  .remember-me { font-size: 0.82rem; }
  .forgot-password { font-size: 0.82rem; }
  .role-switch span,
  .role-switch a,
  .role-switch button { font-size: 0.85rem; padding: 9px; }
}

@media (max-width: 360px) {
  .login-card { padding: 22px 16px; }
  .card-title { font-size: 1.35rem; }
  .form-group input,
  .form-group select { padding: 10px 10px 10px 36px; font-size: 0.85rem; }
  .btn-login,
  .btn-signup,
  .btn-register { padding: 12px; font-size: 0.9rem; }
}
