:root {
  /* Brand Colors */
  --victory-blue-dark: #02458D;
  --victory-blue-bright: #227EEE;
  --victory-orange: #F0994E;

  /* Neutral Colors */
  --bg-color: #f0f4f8;
  /* Darker, blue-tinted gray for better contrast against white paper */
  --bg-secondary: #F8F9FA;
  --text-main: #202124;
  /* Google's almost-black */
  --text-muted: #6A6A6A;
  --border-color: #E0E0E0;

  /* Form Elements */
  --input-bg: #F0F0F0;
  --input-border: transparent;
  --input-radius: 8px;
  /* Slightly more rounded but not full capsule for text inputs for better UX */

  /* Component Specific */
  --card-bg: #FFFFFF;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --section-spacing: 2.5rem;
}

[data-bs-theme="dark"] {
  /* Dark Mode Branding - Deep Navy Theme */
  --victory-blue-dark: #6ea8fe;
  /* Lighter blue for dark mode visibility */
  --victory-blue-bright: #227EEE;
  --victory-orange: #F0994E;

  --bg-color: #0f172a;
  /* Slate 900 - Deep Navy */
  --bg-secondary: #1e293b;
  /* Slate 800 */
  --text-main: #e2e8f0;
  --text-muted: #cbd5e1;
  --border-color: #334155;

  --input-bg: #0f172a;
  /* Darker than card for recessed look */
  --input-radius: 8px;

  --card-bg: #1e293b;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Input Group Addons (Prefixes) */
.input-group-text {
  background-color: var(--input-bg);
  border-color: transparent;
  color: var(--text-muted);
  border-radius: var(--input-radius) 0 0 var(--input-radius);
  /* Match input radius */
  border: 1px solid transparent;
}

[data-bs-theme="dark"] .input-group-text {
  color: var(--text-main);
  border-color: var(--border-color);
  /* Optional: add slight border if needed, or keep transparent */
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Nunito Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.6;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6,
.main-title {
  color: var(--victory-blue-dark);
  font-weight: 800;
  /* Extra Bold from brand */
}

/* Card / Container */
.form-container {
  background-color: var(--card-bg);
  border-radius: 12px;
  /* Material Design radius */
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  /* Deeper shadow for "lifted" effect */
  padding: 3rem;
  margin: 3rem auto;
  /* More spacing from top */
  max-width: 770px;
  /* Standard Google Form width approx */
  border-top: 12px solid var(--victory-blue-dark);
  /* Google Form Color Strip */
  transition: background-color 0.3s ease;
}

@media (max-width: 768px) {
  body {
    background-color: var(--card-bg);
    /* Match container for seamless look */
  }

  .form-container {
    box-shadow: none;
    border-radius: 0;
    padding: 1.25rem;
    /* Reduced from 1.5rem for better mobile spacing */
    margin: 0;
    border-top: 6px solid var(--victory-blue-dark);
    /* Thinner on mobile */
    min-height: 100vh;
    /* Full height for better UX */
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Section Spacing */
  .section-title {
    margin-top: 1.5rem;
    /* Reduced from 2.5rem */
    margin-bottom: 1rem;
    font-size: 1rem;
    /* Slightly smaller */
  }

  .main-title {
    font-size: 1.5rem;
    /* Smaller on mobile */
    margin-bottom: 1.5rem !important;
  }

  /* Touch-Friendly Buttons */
  .btn {
    min-height: 44px;
    /* iOS/Android touch target */
    padding: 12px 20px;
  }

  .btn-brand {
    font-size: 1rem;
    /* Slightly smaller */
    padding: 14px 24px;
  }

  .btn-sm {
    min-height: 38px;
    padding: 8px 16px;
  }

  /* Form Inputs - Larger Touch Targets */
  .form-control,
  .form-select {
    padding: 14px 16px;
    /* Larger touch targets */
    font-size: 16px;
    /* Prevents iOS zoom */
  }

  .input-group-text {
    padding: 14px 12px;
    font-size: 16px;
  }

  .row.g-3 {
    --bs-gutter-y: 1rem;
    /* Reduce vertical spacing */
  }

  .conditional-section {
    padding: 1rem;
    /* Reduced from 1.5rem */
    margin-top: 0.75rem;
  }

  /* Table Responsiveness (Admin Page) */
  .table-responsive {
    margin: 0 -1.25rem;
    /* Extend to container edges */
    padding: 0 1.25rem;
  }

  .table {
    font-size: 0.875rem;
    /* Smaller text */
  }

  .table th,
  .table td {
    padding: 0.5rem;
    /* Reduced padding */
    white-space: nowrap;
  }

  /* Form Check Elements - Better Touch Targets */
  .form-check {
    padding-left: 2rem;
    /* More space for touch */
    margin-bottom: 0.75rem;
  }

  .form-check-input {
    width: 1.3em;
    height: 1.3em;
    margin-top: 0.15em;
  }

  .form-check-label {
    padding-left: 0.5rem;
    line-height: 1.5;
  }

  /* Form Switch */
  .form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
  }
}

/* Buttons */
.btn-brand {
  background-color: var(--victory-orange);
  border-color: var(--victory-orange);
  color: #fff;
  border-radius: 30px;
  /* Brand rounded style */
  padding: 10px 24px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(240, 153, 78, 0.2);
}

.btn-brand:hover,
.btn-brand:focus,
.btn-brand:active {
  background-color: #e08e45 !important;
  /* Slightly darker orange */
  border-color: #e08e45 !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(240, 153, 78, 0.3);
}

.btn-outline-primary {
  border-color: var(--victory-blue-bright);
  color: var(--victory-blue-bright);
  border-radius: 50px;
}

.btn-outline-primary:hover {
  background-color: var(--victory-blue-bright);
  border-color: var(--victory-blue-bright);
}

/* Forms */
.form-label {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-control,
.form-select {
  background-color: var(--input-bg);
  border: 1px solid transparent;
  /* No border initially */
  border-radius: var(--input-radius);
  padding: 12px 16px;
  color: var(--text-main);
  font-weight: 400;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  background-color: var(--bg-color);
  /* White/Dark bg on focus */
  border-color: var(--victory-blue-bright);
  box-shadow: 0 0 0 4px rgba(34, 126, 238, 0.1);
  /* Subtle blue glow */
  color: var(--text-main);
}

/* Section Titles */
.section-title {
  color: var(--victory-blue-dark);
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

[data-bs-theme="dark"] .section-title {
  color: var(--victory-blue-bright);
}

/* Conditional Sections */
.conditional-section,
.group-item {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--victory-blue-bright);
}

/* Brand Text Highlights */
.brand-text {
  color: var(--victory-blue-bright) !important;
  font-weight: 700;
}

/* Switches */
.form-check-input:checked {
  background-color: var(--victory-blue-dark);
  border-color: var(--victory-blue-dark);
}

.form-switch .form-check-input {
  height: 1.5em;
  width: 3em;
  cursor: pointer;
}

/* Checkboxes */
.form-check-input {
  width: 1.2em;
  height: 1.2em;
  margin-top: 0.2em;
  border-color: #ccc;
}

.form-check-input:checked {
  background-color: var(--victory-blue-dark);
  border-color: var(--victory-blue-dark);
}

/* Invalid Feedback */
.invalid-feedback {
  font-weight: 600;
  margin-top: 0.5rem;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-container {
  animation: fadeIn 0.6s ease-out;
}