/* ============================================================
   DRIVER AUTH CSS — Ghost Shopper
   Branded Header, Hero Section, 2-Tier Footer
   ============================================================ */

:root {
  --navy: #1B2B6B;
  --navy-deep: #030E38;
  --orange: #F97316;
  --orange-dark: #ea580c;
  --orange-soft: #FFF7ED;
  --bg: #F9FAFB;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --input-bg: #ffffff;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.driver-auth-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ============================================================
   HEADER
   ============================================================ */
.driver-auth-header {
  background-color: var(--navy);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.driver-auth-header .brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.driver-auth-header .brand img {
  height: 36px; 
  width: auto;
  object-fit: contain;
}

.driver-auth-header .brand .brand-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  margin-left: 10px;
  letter-spacing: -0.01em;
}

.driver-auth-header .brand .brand-text span {
  color: var(--orange);
}

.driver-auth-header .back-link {
  color: #d1d5db;
  text-decoration: none;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}
.driver-auth-header .back-link:hover { color: #ffffff; }

/* ============================================================
   MAIN & CARD
   ============================================================ */
.driver-auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.driver-auth-card {
  background: #ffffff;
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
  margin: auto;
  overflow: hidden; /* Ensures hero background stays inside the rounded corners */
}

/* ============================================================
   HERO SECTION (Inside the Card)
   ============================================================ */
.driver-hero-section {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  padding: 2rem 1.5rem;
  text-align: center;
  color: #ffffff;
  position: relative;
}

.driver-hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(249,115,22,0.3), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.driver-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background-color: var(--orange);
  color: #fff;
  border-radius: 50%;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
  position: relative;
  z-index: 1;
}

.driver-hero-section h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
  position: relative;
  z-index: 1;
}

.driver-hero-section p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
  max-width: 280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ============================================================
   FORMS
   ============================================================ */
.driver-form-wrap {
  padding: 1.5rem;
}

.driver-form-group { margin-bottom: 1rem; position: relative; }
.driver-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }

.driver-form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.driver-input-wrap { position: relative; display: flex; align-items: center; }

.driver-input-wrap i.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-secondary);
  font-size: 1rem;
  pointer-events: none;
}

.driver-input-wrap input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--input-bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.driver-input-wrap input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

/* PHONE SPECIFIC */
.driver-phone-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--input-bg);
  overflow: hidden;
}
.driver-phone-wrap:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}
.driver-phone-prefix {
  background: #f3f4f6;
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-right: 1px solid var(--border);
}
.driver-phone-wrap input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding-left: 0.75rem !important;
}

/* PASSWORD TOGGLE */
.password-toggle-btn {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.password-toggle-btn:hover { color: var(--navy); }

/* BUTTONS */
.driver-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--orange);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 0.5rem;
}
.driver-btn-primary:hover:not(:disabled) { background-color: var(--orange-dark); }
.driver-btn-primary:disabled { background-color: #fdba74; cursor: not-allowed; }

/* LINKS */
.driver-auth-links { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; font-size: 0.85rem; }
.driver-auth-links a { color: var(--navy); text-decoration: none; font-weight: 600; }
.driver-auth-links a:hover { text-decoration: underline; }

.driver-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.driver-checkbox-group input { margin-top: 0.2rem; accent-color: var(--orange); }
.driver-checkbox-group a { color: var(--navy); font-weight: 600; text-decoration: none; }

/* ============================================================
   FOOTER (2-Tier Professional)
   ============================================================ */
.driver-auth-footer {
  background-color: var(--navy);
  color: #ffffff;
  flex-shrink: 0;
  padding: 1rem 1.5rem 0.5rem;
}

.driver-footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

.driver-footer-links a {
  color: #d1d5db;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: color 0.2s;
}
.driver-footer-links a:hover { color: #ffffff; }

.driver-footer-copyright {
  text-align: center;
  font-size: 0.7rem;
  color: #9ca3af;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 0.75rem;
}

/* ============================================================
   MODAL
   ============================================================ */
.driver-legal-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.driver-legal-modal.active { display: flex; }
.driver-legal-content { background: #fff; width: 100%; max-width: 600px; max-height: 85vh; border-radius: var(--radius-lg); display: flex; flex-direction: column; }
.driver-legal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); }
.driver-legal-header h3 { font-size: 1.1rem; color: var(--navy); }
.driver-legal-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; }
.driver-legal-body { padding: 1.5rem; overflow-y: auto; font-size: 0.9rem; line-height: 1.6; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .driver-auth-main { padding: 1rem; }
  .driver-form-row { grid-template-columns: 1fr; }
  .driver-auth-card { border-radius: 0; border-left: none; border-right: none; }
}
/* Styling for the Legal Modal Content */
.driver-legal-body .legal-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.driver-legal-body .legal-body h3:first-child {
  margin-top: 0;
}
.driver-legal-body .legal-body p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.driver-legal-body .legal-body ul {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}
.driver-legal-body .legal-body li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}
/* ============================================================
   BRANDED MODAL OVERRIDES (Smaller + Color)
   ============================================================ */
.driver-legal-modal {
  /* Slightly darker backdrop for focus */
  background: rgba(0, 0, 0, 0.75); 
}

.driver-legal-content {
  /* Smaller max-width for desktop */
  max-width: 480px; 
  /* Ensure it fits nicely on mobile */
  max-height: 80vh; 
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.driver-legal-header {
  /* Navy background for the header */
  background-color: var(--navy);
  padding: 1.25rem 1.5rem;
  border-bottom: none;
}

.driver-legal-header h3 {
  /* White text for the header */
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.driver-legal-close {
  /* Make the close button orange */
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.driver-legal-close:hover {
  color: #ffffff;
  background: var(--orange);
  transform: rotate(90deg);
}

.driver-legal-body {
  padding: 1.5rem;
  /* Keep the body clean */
  background: #ffffff; 
}

/* Custom Scrollbar for the modal body */
.driver-legal-body::-webkit-scrollbar {
  width: 6px;
}
.driver-legal-body::-webkit-scrollbar-track {
  background: #f3f4f6; 
  border-radius: 8px;
}
.driver-legal-body::-webkit-scrollbar-thumb {
  background: var(--orange); 
  border-radius: 8px;
}
.driver-legal-body::-webkit-scrollbar-thumb:hover {
  background: var(--orange-dark); 
}

/* Add a subtle orange accent line at the bottom of the modal */
.driver-legal-content::after {
  content: '';
  display: block;
  height: 4px;
  background: var(--orange);
  width: 100%;
  border-radius: 0 0 16px 16px;
}
/* ============================================================
   FIX: Phone Input Container (Removes double border)
   ============================================================ */
.driver-phone-wrap {
  display: flex;
  align-items: stretch; /* Ensures the prefix and input are the same height */
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--input-bg);
  overflow: hidden;
  width: 100%;
}

.driver-phone-wrap:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.driver-phone-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  padding: 0 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

/* Force the input inside the phone wrapper to have NO border/bg */
.driver-phone-wrap input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0.75rem 1rem !important;
  margin: 0 !important;
  width: 100%;
  font-size: 0.95rem;
  color: var(--text);
  font-family: inherit;
}

/* Ensure the input doesn't show focus rings that clash */
.driver-phone-wrap input:focus {
  outline: none !important;
  box-shadow: none !important;
}
/* ============================================================
   HEADER BRANDING (Ghost [Driver])
   ============================================================ */
.driver-auth-header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.driver-auth-header .brand-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff; /* White text on navy header */
  letter-spacing: -0.01em;
}

/* The Driver Pill Badge */
.brand-driver-badge {
  background: var(--orange);
  color: #fff;
  font-size: 0.65rem; /* Slightly larger for mobile readability */
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

/* Mobile Adjustment so it doesn't cramp */
@media (max-width: 400px) {
  .driver-auth-header {
    padding: 0.75rem 1rem; /* Less padding on mobile */
  }
  .driver-auth-header .brand img {
    height: 30px; /* Slightly smaller logo on mobile */
  }
  .driver-auth-header .brand-text {
    font-size: 1rem;
  }
  .brand-driver-badge {
    font-size: 0.6rem;
    padding: 3px 8px;
  }
  .driver-auth-header .back-link {
    font-size: 0.75rem; /* Smaller text for the right side */
  }
}