/* ================================================
   CORE STYLES - main.css
   Contains all non-form related styles
================================================ */

/* VARIABLES & DESIGN TOKENS */
:root {
  --primary: #002939;
  --primary-dark: #014254;
  --secondary: #D21F2F;
  --light: #f9fafb;
  --white: #ffffff;
  --gray: #6c757d;
  --gray-light: #e9ecef;
  --dark: #212529;
  --font-main: 'Inter', sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --border-radius: 6px;
  --border-radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s ease;
}

/* RESET + BASE */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* TYPOGRAPHY */
body,
h1, h2, h3, h4, h5, h6,
p, a, ul, ol, li, input, select, button {
  font-family: var(--font-main), sans-serif !important;
}

body {
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--dark);
  background-color: var(--light);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-top: 80px;
  letter-spacing: 0.01em;
}

html {
  scroll-padding-top: 80px;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

/* Typography */
h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2rem; color: var(--secondary); }
h3 { font-size: 1.5rem; color: var(--primary); }

p { margin-bottom: var(--space-md); }

/* LAYOUT */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section-padding {
  padding: var(--space-xl) 0;
}

.text-center {
  text-align: center;
}

/* HEADER */
.site-header {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  height: 60px;
  padding: 10px 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 100%;
}

.site-header .logo img {
  height: 40px;
  width: auto;
}

/* NAVIGATION */
.main-nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  align-items: center;
}

.main-nav a {
  color: #333;
  font-weight: 500;
  font-size: 1rem;
  transition: var(--transition);
}

.main-nav a:hover {
  color: var(--secondary);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle .bar {
  width: 25px;
  height: 2px;
  background: #333;
  margin: 5px 0;
  transition: var(--transition);
}

/* HERO SECTION */
.hero-section {
  background-color: var(--light);
  padding: var(--space-xl) 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.hero-text-content {
  max-width: 600px;
}

.hero-description {
  font-size: 1.25rem;
  margin: var(--space-md) 0;
  color: var(--gray);
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 500;
  color: var(--gray);
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.hero-image-wrapper {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* FEATURES */
.features {
  padding: var(--space-xl) 0;
  background-color: var(--white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.feature-card {
  text-align: center;
  padding: var(--space-lg);
  border-radius: var(--border-radius-lg);
  transition: transform var(--transition);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.feature-card img {
  height: 200px;
  object-fit: cover;
  border-radius: var(--border-radius);
  margin-bottom: var(--space-md);
}

/* BUTTONS (Base styles) */
.btn {
  display: inline-block;
  padding: 0.875rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--border-radius);
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--secondary);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.cta-btn {
  background-color: var(--secondary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.cta-btn:hover {
  background-color: var(--primary-dark);
  color: #fff;
  box-shadow: var(--shadow-md);
}

/* RESPONSIVE STYLES */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .features-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .hero-cta { flex-direction: column; }
  .features-grid { grid-template-columns: 1fr; }
  
  .menu-toggle {
    display: block;
  }
  
  .menu-toggle.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  
  .menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }
  
  .menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  
  .main-nav {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: var(--shadow-lg);
    padding: 2rem 1.5rem;
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    z-index: 1000;
  }
  
  .main-nav.active {
    transform: translateY(0);
  }
  
  .main-nav ul {
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* ================================================
   FORM STYLES
================================================ */
.form-wrapper {
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

.form-header {
  text-align: center;
  margin-bottom: var(--space-lg);
  background: none; /* Reverted to original no-background style */
}

.form-header h1 {
  color: var(--primary);
  font-size: 2rem;
}

.form-header p {
  color: var(--gray);
}

/* Progress Steps */
.progress-container {
  margin: var(--space-lg) 0;
}

.progress-bar {
  height: 6px;
  background: var(--gray-light);
  border-radius: 3px;
  margin-bottom: var(--space-sm);
}

.progress {
  height: 100%;
  background: var(--secondary);
  border-radius: 3px;
  width: <?php echo ($_SESSION['step'] / 6 * 100); ?>%;
  transition: width 0.3s ease;
}

.step-labels {
  display: flex;
  justify-content: space-between;
}

.step-labels span {
  font-size: 0.8rem;
  color: var(--gray);
}

.step-labels span.current {
  color: var(--primary);
  font-weight: 600;
}

/* Form Fields */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
  color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  font-size: 1rem;
}

.form-group input[readonly] {
  background: #f8f9fa;
  cursor: not-allowed;
}

.form-group.error input,
.form-group.error select {
  border-color: var(--secondary);
}

.error-message {
  font-size: 0.875rem;
  color: var(--secondary);
}

.form-message {
  padding: 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  text-align: center;
}

.form-message.success {
  background: #d4edda;
  color: #155724;
}

.form-message.error {
  background: #f8d7da;
  color: #721c24;
}

/* Phone Input */
.phone-input-group {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.custom-country-select {
  position: relative;
  width: 150px;
}

.selected-option {
  padding: 0.75rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  font-size: 1rem;
  position: relative;
  z-index: 1; /* Ensure it stays above the dropdown */
}

.selected-option::after {
  content: '▼';
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray);
}

.country-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  margin-top: -1px; /* Overlap the selected option border */
}

.search-box {
  padding: var(--space-xs);
  border-bottom: 1px solid var(--gray-light);
}

.search-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
}

.options-list {
  max-height: 150px;
  overflow-y: auto;
}

.country-option {
  padding: 0.75rem var(--space-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.country-option:hover {
  background: var(--gray-light);
}

.flag-icon {
  width: 1.5rem;
  height: 1rem;
  border-radius: 2px;
}

.phone-number-container {
  flex: 1;
}

.pbc-phone-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  font-size: 1rem;
}

/* Buttons */
.form-nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-lg);
  gap: var(--space-sm);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-back {
  background: var(--gray-light);
  color: var(--dark);
}

.btn-back:hover {
  background: var(--gray);
  color: var(--white);
}

.btn-save {
  background: var(--primary);
  color: var(--white);
}

.btn-save:hover {
  background: var(--primary-dark);
}

.btn-next {
  background: var(--secondary);
  color: var(--white);
}

.btn-next:hover {
  background: var(--primary-dark);
}

@media (max-width: 768px) {
  .form-nav {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
  .phone-input-group {
    flex-direction: column;
    align-items: stretch;
  }
  .custom-country-select {
    width: 100%;
  }
}


/* ================================================
   FORM STYLES
================================================ */
.form-wrapper {
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

.form-header {
  text-align: center;
  margin-bottom: var(--space-lg);
  background: none;
}

.form-header h1 {
  color: var(--primary);
  font-size: 2rem;
}

.form-header p {
  color: var(--gray);
}

/* Progress Steps */
.progress-container {
  margin: var(--space-lg) 0;
}

.progress-bar {
  height: 6px;
  background: var(--gray-light);
  border-radius: 3px;
  margin-bottom: var(--space-sm);
}

.progress {
  height: 100%;
  background: var(--secondary);
  border-radius: 3px;
  width: <?php echo ($_SESSION['step'] / 6 * 100); ?>%;
  transition: width 0.3s ease;
}

.step-labels {
  display: flex;
  justify-content: space-between;
}

.step-labels span {
  font-size: 0.8rem;
  color: var(--gray);
}

.step-labels span.current {
  color: var(--primary);
  font-weight: 600;
}

/* Form Fields */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
  color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  font-size: 1rem;
}

.form-group input[readonly] {
  background: #f8f9fa;
  cursor: not-allowed;
}

.form-group.error input,
.form-group.error select {
  border-color: var(--secondary);
}

.error-message {
  font-size: 0.875rem;
  color: var(--secondary);
}

.form-message {
  padding: 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  text-align: center;
}

.form-message.success {
  background: #d4edda;
  color: #155724;
}

.form-message.error {
  background: #f8d7da;
  color: #721c24;
}

/* Phone Input */
.phone-input-group {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.custom-country-select {
  position: relative;
  width: 150px;
}

.selected-option {
  padding: 0.75rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem; /* Reduced gap for compact display */
  background: var(--white);
  font-size: 1rem;
  position: relative;
  z-index: 1;
}

.selected-option::after {
  content: '▼';
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray);
}

.country-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  margin-top: -1px;
}

.search-box {
  padding: var(--space-xs);
  border-bottom: 1px solid var(--gray-light);
}

.search-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
}

.options-list {
  max-height: 150px;
  overflow-y: auto;
}

.country-option {
  padding: 0.75rem var(--space-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem; /* Reduced gap for compact display */
  font-size: 1rem;
}

.country-option:hover {
  background: var(--gray-light);
}

.country-code {
  font-weight: 600;
  width: 2rem; /* Fixed width for alignment */
}

.flag-icon {
  width: 1.5rem;
  height: 1rem;
  border-radius: 2px;
}

.dial-code {
  margin-left: auto; /* Push phone code to the right */
}

.phone-number-container {
  flex: 1;
}

.pbc-phone-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  font-size: 1rem;
}

/* Buttons */
.form-nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-lg);
  gap: var(--space-sm);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-back {
  background: var(--gray-light);
  color: var(--dark);
}

.btn-back:hover {
  background: var(--gray);
  color: var(--white);
}

.btn-save {
  background: var(--primary);
  color: var(--white);
}

.btn-save:hover {
  background: var(--primary-dark);
}

.btn-next {
  background: var(--secondary);
  color: var(--white);
}

.btn-next:hover {
  background: var(--primary-dark);
}

@media (max-width: 768px) {
  .form-nav {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
  .phone-input-group {
    flex-direction: column;
    align-items: stretch;
  }
  .custom-country-select {
    width: 100%;
  }
}
.form-header {
    background-color: var(--brand-blue, #002939); /* Fallback to #002939 if --brand-blue isn't defined */
    color: #ffffff; /* White text */
    padding: 1.5rem;
    text-align: center;
    border-radius: 6px 6px 0 0; /* Optional: rounded top corners */
}

.form-header h1 {
    color: #ffffff; /* Ensure the h1 is white */
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
}

.form-header p {
    color: #ffffff; /* Ensure the p is white */
    font-size: 1rem;
    margin: 0;
    opacity: 0.9; /* Slight transparency for subtitle effect */
}