/* Mental Health Study Website – Premium Modern Theme */

:root {
  /* Vibrant & Sophisticated Color Palette */
  --p-50: #f0fdf4;
  --p-100: #dcfce7;
  --p-200: #bbf7d0;
  --p-500: #22c55e;
  --p-600: #16a34a;
  --p-700: #15803d;
  --p-800: #166534;
  --p-900: #14532d;

  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-900: #134e4a;

  --s-50: #f8fafc;
  --s-100: #f1f5f9;
  --s-200: #e2e8f0;
  --s-300: #cbd5e1;
  --s-500: #64748b;
  --s-700: #334155;
  --s-900: #0f172a;

  /* Semantic Colors */
  --bg: #f9fafb;
  --surface: #ffffff;
  --text: var(--s-900);
  --text-muted: var(--s-500);
  --accent: var(--teal-600);
  --border: var(--s-200);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* Layout */
  --max-width: 800px;
  --radius: 12px;
  --space: 1.5rem;
}

/* Base Polish */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space);
}

.container--wide {
  max-width: 1000px;
}

/* Premium Header */
.site-header--compact {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.9);
}

.site-header--compact .container--wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  color: var(--text);
  text-decoration: none;
  display: block;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  color: var(--teal-900);
  letter-spacing: -0.02em;
}

.site-subtitle {
  font-size: 0.85rem;
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}

/* Navigation */
.nav-menu {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.nav-menu a:hover {
  color: var(--teal-600);
  background: var(--teal-50);
}

.nav-menu a.active {
  color: #fff;
  background: var(--teal-600);
}

.nav-toggle {
  display: none;
  background: var(--s-100);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* Hero / Sections */
.section {
  padding: 4rem 0;
}

.landing-hero {
  background: radial-gradient(circle at top right, var(--teal-50), var(--bg));
  text-align: center;
}

.landing-hero__title {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: var(--s-900);
}

.landing-hero__lead {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--teal-600);
  color: #fff;
  box-shadow: 0 4px 14px 0 rgba(13, 148, 136, 0.39);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.23);
  background: var(--teal-500);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--s-50);
  border-color: var(--s-300);
}

/* Survey UI Overhaul */
.survey-page {
  background: var(--bg);
  padding-top: 2rem;
}

#survey-form-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.survey-progress {
  margin-bottom: 2.5rem;
}

.survey-progress-text {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--teal-600);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.75rem;
}

.survey-progress-bar {
  height: 10px;
  background: var(--s-100);
  border-radius: 10px;
  overflow: hidden;
}

.survey-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal-500), var(--teal-600));
  transition: width 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.survey-form h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--s-900);
}

.survey-form fieldset {
  border: 1px solid var(--s-100);
  background: var(--s-50);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.survey-form legend {
  font-weight: 700;
  color: var(--teal-900);
  background: var(--teal-100);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.survey-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--s-700);
  font-size: 1rem;
}

.survey-form p[style*="margin-bottom"] {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: -0.25rem;
  margin-bottom: 1.5rem !important;
}

.survey-form input[type="text"],
.survey-form input[type="email"],
.survey-form input[type="number"],
.survey-form select,
.survey-form textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s;
}

.survey-form textarea {
  resize: vertical;
  min-height: 80px;
}

.survey-form input:focus,
.survey-form select:focus,
.survey-form textarea:focus {
  border-color: var(--teal-500);
  outline: none;
  box-shadow: 0 0 0 4px var(--teal-100);
}

/* Custom Range Slider Premium Polish */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--s-100);
  border-radius: 999px;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 28px;
  width: 28px;
  background: var(--teal-600);
  cursor: pointer;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--teal-500);
  box-shadow: 0 10px 15px -3px rgba(13, 148, 136, 0.3);
}

input[type="range"]::-moz-range-thumb {
  height: 24px;
  width: 24px;
  background: var(--teal-600);
  cursor: pointer;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Custom Checkbox Styling */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background-color: #fff;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: all 0.2s ease;
  vertical-align: middle;
  margin-right: 12px;
}

input[type="checkbox"]::before {
  content: "";
  width: 14px;
  height: 14px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--teal-600);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:checked {
  border-color: var(--teal-600);
  background: var(--teal-50);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

input[type="checkbox"]:focus {
  outline: 2px solid var(--teal-100);
  outline-offset: 2px;
}

/* Steps Transition */
.survey-step {
  display: none;
}

.survey-step.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cards for landing */
.landing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

.landing-card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 2.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.landing-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal-500);
}

.landing-card h3 {
  color: var(--teal-900);
  margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .landing-hero__title {
    font-size: 1.8rem;
  }

  .landing-cards {
    grid-template-columns: 1fr;
  }

  .nav-menu {
    display: none;
  }

  .nav-menu.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-toggle {
    display: block;
  }

  #survey-form-wrap {
    padding: 1.5rem;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .survey-form fieldset {
    padding: 1rem;
  }

  .survey-form label {
    font-size: 0.9rem;
  }

  .survey-step-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .survey-step-actions .btn {
    width: 100%;
  }

  .site-header .container--wide {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .site-title {
    font-size: 1.25rem;
  }

  .site-subtitle {
    font-size: 0.85rem;
  }

  h2,
  h3 {
    font-size: 1.5rem;
  }

  .section {
    padding: 2rem 0;
  }
}

@media (max-width: 480px) {
  .survey-form input[type="range"] {
    width: 100%;
  }

  .survey-progress-text {
    font-size: 0.85rem;
  }

  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }

  .survey-form fieldset legend {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
}

.hidden {
  display: none !important;
}