/* ==========================================================================
   Dr. Jess Page Clinical Psychology – Main Stylesheet
   ========================================================================== */

/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Brand */
  --brand-600: #7642d3; /* primary purple */
  --brand-700: #5e2fb8; /* darker shade */

  /* Subtle purple tints (cool lilac family) */
  --brand-50:  #f7f2ff; /* softest backdrop */
  --brand-75:  #ece3ff; /* chip / icon backgrounds */
  --brand-100: #e5d9ff; /* image underlays / panels */

  /* Neutrals / text */
  --ink-900: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;

  /* Borders / muted */
  --muted-300: #e2e8f0;
  --muted-400: #cbd5e1;
  --muted-500: #94a3b8;

  /* Convenience */
  --bg-subtle: var(--brand-50);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--ink-900);
  background-color: #ffffff;
}

/* === Accessibility === */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(118,66,211,.5);
  outline-offset: 2px;
}

/* === Layout === */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.min-h-screen { min-height: 100vh; }
.bg-white { background-color: #ffffff; }
.text-center { text-align: center; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Responsive grids */
.grid-2, .grid-3 { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* Helper: subtle brand backdrops */
.bg-subtle   { background-color: var(--brand-50); }
.chip-subtle { background-color: var(--brand-75); border-radius: 9999px; }
.card-bg     { background-color: var(--brand-50); }

/* Hide something only on mobile */
@media (max-width: 767.98px) { .hide-mobile { display: none !important; } }

/* Slightly increase container padding on very large screens */
@media (min-width: 1280px) { .container { padding-left: 2rem; padding-right: 2rem; } }

/* === Navigation === */
nav {
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  position: sticky; top: 0; z-index: 50;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; }

.nav-logo {
  font-family: 'Lexend', sans-serif; font-size: 1.25rem; font-weight: 700;
  color: var(--brand-600); text-decoration: none; transition: color .3s;
}
.nav-logo:hover { color: var(--brand-700); }

.nav-desktop { display: none; gap: 2rem; }
@media (min-width: 768px) { .nav-desktop { display: flex; } }

.nav-link {
  color: var(--ink-600); text-decoration: none; font-weight: 500;
  transition: color .3s; position: relative; padding-bottom: .25rem;
}
.nav-link:hover, .nav-link.active { color: var(--brand-600); }
.nav-link.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background-color: var(--brand-600);
}

/* Mobile menu */
.mobile-menu-button {
  display: block; background: none; border: none; cursor: pointer;
  color: #522b9e; padding: .5rem;
}
@media (min-width: 768px) { .mobile-menu-button { display: none; } }

.mobile-menu[hidden] { display: none !important; }
.mobile-menu { display: none; background-color: #ffffff; border-top: 1px solid var(--muted-300); padding: 1rem 0; }
.mobile-menu.active { display: block; }

.mobile-nav-link {
  display: block; padding: .75rem 1.5rem; color: var(--ink-600); text-decoration: none;
  font-weight: 500; transition: background-color .3s, color .3s;
}
.mobile-nav-link:hover { background-color: var(--brand-50); color: var(--brand-600); }
.mobile-nav-link.active { color: var(--brand-600); background-color: var(--brand-50); }

/* === Buttons === */
.btn-primary,
.btn-secondary,
.btn-white,
.btn-outline-white {
  display: inline-block; font-weight: 500; padding: .75rem 1.5rem;
  border-radius: .375rem; text-decoration: none; transition: all .3s;
}

.btn-primary { background-color: var(--brand-600); color: #ffffff; }
.btn-primary:hover { background-color: var(--brand-700); transform: translateY(-1px); }

.btn-secondary {
  background-color: #ffffff; color: var(--brand-600);
  border: 2px solid var(--brand-600);
}
.btn-secondary:hover { background-color: var(--brand-600); color: #ffffff; }

.btn-white { background-color: #ffffff; color: var(--brand-600); }
.btn-white:hover { background-color: var(--brand-50); transform: translateY(-1px); }

.btn-outline-white {
  background-color: transparent; color: #ffffff; border: 2px solid #ffffff;
}
.btn-outline-white:hover { background-color: rgba(255,255,255,.1); }

/* === Cards / Effects === */
.card-shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  transition: box-shadow .3s;
}
.card-shadow-lg:hover {
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
}

/* === Gradients === */
.gradient-white-purple { background: linear-gradient(to bottom, #ffffff, var(--brand-50)); }
.gradient-purple       { background-color: var(--brand-600); }

/* === Forms === */
.form-group { margin-bottom: 1.5rem; }
label, .form-label { display: block; margin-bottom: .5rem; font-weight: 500; color: var(--ink-700); }
.form-required { color: #ef4444; font-weight: 600; }

input[type="text"], input[type="email"], input[type="tel"],
select, textarea,
.form-input, .form-textarea {
  width: 100%; padding: .75rem; border: 1px solid var(--muted-300); border-radius: .375rem;
  font: inherit; font-size: 1rem; transition: border-color .2s, box-shadow .2s;
}
textarea, .form-textarea { resize: vertical; min-height: 150px; }

input:focus, select:focus, textarea:focus,
.form-input:focus, .form-textarea:focus {
  outline: none; border-color: var(--brand-600);
  /* Subtle brand glow without harshness */
  box-shadow: 0 0 0 3px rgba(118,66,211,.1);
}

/* === Images === */
img { max-width: 100%; height: auto; display: block; }

/* === Links (keep clean; underline on hover optional via utility) === */
a { text-decoration: none; }
a:hover { text-decoration: none; }

/* === FAQ Accordion === */
.faq-item { border-bottom: 1px solid var(--brand-75); padding: 1rem .5rem; }
.faq-item:last-child { border-bottom: none; }

.faq-question {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: none; border: none; cursor: pointer; padding: 0; text-align: left;
}
.faq-question:hover h3 { color: var(--brand-600); }

.faq-icon { transition: transform .3s; flex-shrink: 0; }
.faq-item .faq-icon { transform: rotate(0deg); }
.faq-item.is-open .faq-icon { transform: rotate(180deg); }

.faq-answer { padding-top: .75rem; padding-left: .5rem; }
.faq-answer p { margin-bottom: 0; }
.faq-answer p + p { margin-top: .5rem; }

/* FAQ CTA Buttons: stack on mobile, side-by-side on desktop */
.faq-buttons {
  display: flex; flex-direction: column; gap: 1rem; align-items: center; flex-wrap: wrap;
}
@media (min-width: 768px) {
  .faq-buttons { flex-direction: row; justify-content: center; }
  .faq-buttons a { width: auto; }
}

/* === Footer === */
footer { background-color: var(--brand-600); color: var(--muted-400); padding: 3rem 0 1.5rem; }
.footer-content {
  display: grid; grid-template-columns: 1fr; gap: 2rem; margin-bottom: 2rem;
}
@media (min-width: 768px)  { .footer-content { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-content { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; } }

.footer-section h3,
.footer-section h4 { color: #ffffff; font-size: .875rem; margin-bottom: .75rem; font-family: 'Lexend', sans-serif; }
.footer-section p { line-height: 1.6; color: var(--muted-400); }

.footer-insurance .hcpc-badge { margin-top: 1rem; }
.footer-insurance .hcpc-badge img { height: 4rem; width: auto; border-radius: .75rem; }
.footer-insurance .insurance-logos { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.footer-insurance .insurance-logos img { height: 2.5rem; width: auto; object-fit: contain; border-radius: .75rem; }

.footer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: var(--muted-400); transition: color .3s; }
.footer-links a:hover { color: #ffffff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.2);
  padding-top: 1.5rem; text-align: center; color: #e2e8f0;
}

/* === Motion preferences === */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .btn-primary:hover, .btn-white:hover { transform: none !important; }
  .card-shadow-lg, .card-shadow-lg:hover, .faq-icon { transition: none !important; }
}
