/* Clear Focus Psychiatry - Main Styles
   Design Philosophy: "Digital therapeutic environment" — calming, warm, professional.
   The site is the first clinical interaction, not a marketing page.

   Research basis (Doc 09):
   - Sage/teal + warm sand = grounding, safety-signaling (Gapsy Studio, HostAdvice)
   - Soft charcoal (#333) body text, not harsh black — reduces eye strain (Doc 09 §1)
   - Generous whitespace = "visual exhale" for overwhelmed minds (Doc 09 §1)
   - Rounded elements + predictable nav = less intimidating (CreateToday 2026)
   - Scroll fade-ins, not bounce/fly — regulate nervous system (Doc 09 §8)
   - Sticky mobile CTA bar after hero, not on load (Doc 09 §5)
   - prefers-reduced-motion respected (Doc 09 §8)
*/

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Self-hosted Inter font ── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html { scroll-behavior: smooth; overflow-x: hidden; }
body { overflow-x: hidden; }

/* ── Accessibility ── */
.skip-to-content {
    position: absolute; top: -100%; left: 1rem;
    background: var(--primary); color: white;
    padding: 0.75rem 1.5rem; border-radius: 0 0 8px 8px;
    z-index: 200; font-weight: 600; text-decoration: none;
}
.skip-to-content:focus { top: 0; }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--primary); outline-offset: 2px;
}

:root {
    /* Calming teal — grounding, safety-signaling */
    --primary: #2B7A78;
    --primary-dark: #1A5653;
    --primary-light: #3AAFA9;
    --primary-subtle: #DEF2F1;

    /* Warm accent for CTAs — inviting, not aggressive */
    --accent: #E8985E;
    --accent-hover: #D4844A;

    /* Soft charcoal + warm neutrals (Doc 09: #333 not #000) */
    --text-dark: #333333;
    --text-body: #4A5568;
    --text-light: #6B7280;
    --bg-warm: #FEFCF8;
    --bg-cream: #FBF8F3;
    --bg-white: #FFFFFF;
    --border-color: #E8E2D9;

    --shadow-sm: 0 1px 3px rgba(43, 122, 120, 0.08);
    --shadow-md: 0 4px 12px rgba(43, 122, 120, 0.1);
    --shadow-lg: 0 10px 25px rgba(43, 122, 120, 0.12);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7; color: var(--text-body); background: var(--bg-warm);
}

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

/* ── Scroll Fade-In Animations (Doc 09 §8) ── */
.fade-in-section {
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-section.visible {
    opacity: 1; transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .fade-in-section { opacity: 1; transform: none; transition: none; }
    .fade-in-section.visible { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
    .btn-primary:hover { transform: none; }
    .faq-section details .faq-answer { transition: none; }
}

/* ── Header & Navigation ── */
.header {
    background: var(--bg-white);
    box-shadow: 0 1px 0 var(--border-color);
    position: sticky; top: 0; z-index: 100;
}
.nav {
    max-width: 1100px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 2rem;
}
.logo {
    font-size: 1.2rem; font-weight: 700; color: var(--primary);
    text-decoration: none; letter-spacing: -0.02em;
    white-space: nowrap; flex-shrink: 0;
}
.nav-links { display: flex; gap: 1.25rem; list-style: none; align-items: center; }
.nav-links a {
    color: var(--text-dark); text-decoration: none; font-weight: 500;
    font-size: 0.9rem; transition: color 0.2s; position: relative;
    white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-links a.active::after {
    content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
    height: 2px; background: var(--primary); border-radius: 1px;
}

/* Hamburger */
.nav-toggle {
    display: none; background: none; border: none; cursor: pointer;
    padding: 0.5rem; flex-direction: column; gap: 5px;
}
.nav-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--text-dark); transition: all 0.3s; border-radius: 1px;
}

/* ── Hero ── */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    background-image: linear-gradient(to bottom, rgba(26,86,83,0.55), rgba(43,122,120,0.65)), url('/images/hero-banner.png');
    background-size: cover; background-position: center;
    color: white; padding: 5rem 2rem 4rem; text-align: center; position: relative;
}
.hero::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
    height: 60px; background: var(--bg-warm);
    clip-path: ellipse(55% 100% at 50% 100%);
}
.hero-content {
    max-width: 750px; margin: 0 auto; position: relative; z-index: 1;
}
.hero h1 {
    font-size: 2.5rem; font-weight: 700; margin-bottom: 1.25rem;
    letter-spacing: -0.02em; line-height: 1.2;
}
.hero p { font-size: 1.2rem; margin-bottom: 2rem; opacity: 0.95; line-height: 1.7; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ── */
.btn {
    display: inline-block; padding: 0.85rem 2rem; border-radius: 50px;
    font-weight: 600; text-decoration: none; transition: all 0.25s;
    cursor: pointer; border: none; font-size: 1rem; font-family: inherit;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover {
    background: var(--accent-hover); transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(232, 152, 94, 0.35); color: white;
}
.btn-secondary {
    background: rgba(255,255,255,0.15); color: white;
    border: 2px solid rgba(255,255,255,0.4);
}
.btn-secondary:hover { background: rgba(255,255,255,0.25); color: white; }
.btn-outline {
    background: transparent; color: var(--primary); border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }

/* ── Container ── */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem; }

/* ── Cards ── */
.card {
    background: var(--bg-white); border-radius: 16px; padding: 2rem;
    box-shadow: var(--shadow-sm); transition: box-shadow 0.3s;
}
.card:hover { box-shadow: var(--shadow-md); }

/* ── Features Grid ── */
.features-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem; margin: 2rem 0;
}
.feature-card {
    text-align: center; padding: 2rem 1.5rem;
    border: 1px solid var(--border-color); background: var(--bg-white);
}
.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; display: block; }
.feature-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; color: var(--text-dark); }
.feature-card p { font-size: 0.95rem; color: var(--text-light); }

/* ── Section Headings ── */
.section-heading {
    text-align: center; margin: 4rem 0 2rem; font-size: 1.85rem;
    color: var(--text-dark); font-weight: 700; letter-spacing: -0.02em;
}
.section-subheading {
    text-align: center; color: var(--text-light); font-size: 1.1rem;
    margin-top: -1.5rem; margin-bottom: 2rem;
}

/* ── Trust Bar ── */
.trust-bar { background: var(--primary-subtle); padding: 1rem 2rem; }
.trust-bar-inner {
    max-width: 1100px; margin: 0 auto;
    display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem 2.5rem;
}
.trust-item {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.9rem; font-weight: 500; color: var(--primary-dark);
}
.trust-item .trust-icon { color: var(--primary); font-size: 1.1rem; }

/* ── "Is This You?" Empathy Section (Doc 09 §2) ── */
.empathy-section {
    background: var(--bg-cream); border-radius: 20px;
    padding: 3rem 2.5rem; margin: 3rem 0;
    border: 1px solid var(--border-color);
}
.empathy-section h2 {
    color: var(--text-dark); margin-bottom: 1.5rem; font-size: 1.6rem;
    text-align: center;
}
.empathy-list {
    list-style: none; padding: 0; max-width: 650px; margin: 0 auto 1.5rem;
}
.empathy-list li {
    padding: 0.75rem 0; padding-left: 2rem; position: relative;
    font-size: 1.05rem; color: var(--text-body); line-height: 1.6;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.empathy-list li:last-child { border-bottom: none; }
.empathy-list li::before {
    content: ''; position: absolute; left: 0; top: 1.1rem;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--primary-light); opacity: 0.7;
}
.empathy-cta { text-align: center; margin-top: 1.5rem; }

/* ── Provider Preview (homepage) ── */
.provider-preview {
    display: flex; gap: 2.5rem; align-items: center;
    padding: 2.5rem; margin: 3rem 0;
}
.provider-preview-photo {
    width: 160px; height: 160px; border-radius: 50%;
    background: var(--primary-subtle); display: flex;
    align-items: center; justify-content: center;
    font-size: 4rem; flex-shrink: 0;
}
.provider-preview-text h2 { color: var(--text-dark); margin-bottom: 0.5rem; }
.provider-preview-text p { margin-bottom: 0.75rem; }

/* ── Social Proof / Trust Section (Doc 09 §6) ── */
.social-proof {
    text-align: center; padding: 3rem 2rem; margin: 3rem 0;
    background: var(--primary-subtle); border-radius: 20px;
}
.social-proof h2 { color: var(--text-dark); margin-bottom: 2rem; }
.proof-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem; max-width: 800px; margin: 0 auto;
}
.proof-item {
    background: var(--bg-white); border-radius: 12px; padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.proof-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.proof-item h3 { font-size: 1rem; color: var(--text-dark); margin-bottom: 0.25rem; }
.proof-item p { font-size: 0.85rem; color: var(--text-light); }

/* ── Forms ── */
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block; margin-bottom: 0.5rem; font-weight: 500;
    color: var(--text-dark); font-size: 0.95rem;
}
.form-input {
    width: 100%; padding: 0.85rem 1rem; border: 2px solid var(--border-color);
    border-radius: 12px; font-size: 1rem; transition: border-color 0.2s;
    font-family: inherit; background: var(--bg-white); color: var(--text-dark);
    /* 16px minimum prevents iOS auto-zoom on focus */
    min-height: 48px;
}
.form-input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 122, 120, 0.1);
}

/* ── Alerts ── */
.alert { padding: 1rem 1.25rem; border-radius: 12px; margin-bottom: 1rem; font-size: 0.95rem; }
.alert-success { background: #D4EDDA; color: #155724; border: 1px solid #C3E6CB; }
.alert-error { background: #F8D7DA; color: #721C24; border: 1px solid #F5C6CB; }
.alert-info { background: var(--primary-subtle); color: var(--primary-dark); border: 1px solid #B2DFDB; }

/* ── FAQ Accordion (smooth expand — Doc 09 §8) ── */
.faq-section details {
    background: var(--bg-white); border-radius: 12px; margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm); overflow: hidden; border: 1px solid var(--border-color);
}
.faq-section summary {
    padding: 1.25rem 1.5rem; font-weight: 600; cursor: pointer;
    list-style: none; display: flex; justify-content: space-between;
    align-items: center; color: var(--text-dark); font-size: 1rem;
    transition: background 0.2s;
}
.faq-section summary:hover { background: rgba(43, 122, 120, 0.03); }
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::after {
    content: '+'; font-size: 1.4rem; color: var(--primary);
    flex-shrink: 0; margin-left: 1rem; font-weight: 300;
    transition: transform 0.25s ease;
}
.faq-section details[open] summary::after { content: '−'; }
.faq-section details .faq-answer {
    padding: 0 1.5rem 1.25rem; color: var(--text-body); line-height: 1.7;
}

/* ── Answer-First Block (GEO — Doc 07 §3, Doc 09 §7) ── */
.answer-first {
    background: var(--bg-cream); border-left: 4px solid var(--primary);
    padding: 1.25rem 1.5rem; margin: 2rem 0;
    border-radius: 0 12px 12px 0; font-size: 1.05rem;
    line-height: 1.7; color: var(--text-dark);
}

/* ── CTA Section ── */
.cta-section {
    text-align: center; padding: 3.5rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; border-radius: 20px; margin: 3rem 0;
}
.cta-section h2 { font-size: 1.85rem; margin-bottom: 1rem; font-weight: 700; }
.cta-section p { font-size: 1.15rem; margin-bottom: 2rem; opacity: 0.95; }
.cta-section .btn-primary { background: var(--accent); font-size: 1.1rem; padding: 1rem 2.5rem; }

/* ── Crisis Banner ── */
.crisis-banner { background: #FFF5F5; border: 2px solid #FC8181; border-radius: 16px; padding: 2rem; }
.crisis-banner h3 { color: #C53030; margin-bottom: 1rem; }

/* ── Steps / How It Works ── */
.steps-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem;
}
.step-card { text-align: center; padding: 2rem 1.5rem; }
.step-number {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary-subtle); color: var(--primary);
    font-weight: 700; font-size: 1.2rem; margin-bottom: 1rem;
}
.step-card h3 { color: var(--text-dark); margin-bottom: 0.75rem; font-size: 1.1rem; }

/* ── Condition Tags ── */
.condition-tags { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.condition-tag {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.25rem; background: var(--bg-white);
    border: 1px solid var(--border-color); border-radius: 50px;
    font-size: 0.95rem; color: var(--text-dark); text-decoration: none;
    transition: all 0.25s ease;
}
.condition-tag:hover {
    border-color: var(--primary); color: var(--primary);
    box-shadow: var(--shadow-sm); background: var(--primary-subtle);
}

/* ── Footer ── */
.footer {
    background: var(--text-dark); color: white;
    padding: 3rem 2rem 2rem; margin-top: 4rem;
}
.footer-content {
    max-width: 1100px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem;
}
.footer h4 { margin-bottom: 1rem; font-size: 1rem; }
.footer p, .footer li { font-size: 0.9rem; line-height: 1.8; }
.footer a { color: rgba(255,255,255,0.8); text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: white; }
.footer-bottom {
    text-align: center; margin-top: 2rem; padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; opacity: 0.7;
}
.footer-crisis {
    background: rgba(255,255,255,0.05); border-radius: 8px;
    padding: 1rem; margin-top: 1.5rem; text-align: center; font-size: 0.85rem;
}
.footer-crisis strong { color: #FC8181; }
.last-updated { text-align: center; color: var(--text-light); font-size: 0.85rem; padding: 0.5rem 0; }

/* ── Breadcrumb ── */
.breadcrumb { margin-bottom: 1rem; }
.breadcrumb ol {
    display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none;
    font-size: 0.9rem; color: var(--text-light); margin: 0; padding: 0;
}
.breadcrumb li + li::before { content: '›'; margin-right: 0.25rem; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ── Provider Card (About page) ── */
.provider-card {
    display: grid; grid-template-columns: 280px 1fr;
    gap: 2.5rem; align-items: start;
}
.provider-photo {
    width: 100%; border-radius: 16px; aspect-ratio: 3/4;
    object-fit: cover; background: var(--primary-subtle);
    display: flex; align-items: center; justify-content: center; font-size: 5rem;
}

/* ── Sticky Mobile CTA Bar (Doc 09 §5) ── */
.sticky-cta {
    display: none; /* shown via JS after scrolling past hero */
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-white); border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem; z-index: 90;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}
.sticky-cta-inner {
    max-width: 500px; margin: 0 auto;
    display: flex; gap: 0.75rem; align-items: center;
}
.sticky-cta .btn {
    flex: 1; text-align: center; padding: 0.75rem 1rem;
    font-size: 0.95rem; border-radius: 50px;
}
.sticky-cta .btn-call {
    background: transparent; color: var(--primary);
    border: 2px solid var(--primary); flex: 0 0 auto;
    padding: 0.75rem 1.25rem;
}
.sticky-cta .btn-call:hover { background: var(--primary); color: white; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-links {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--bg-white); flex-direction: column; gap: 0;
        padding: 0; box-shadow: var(--shadow-md);
    }
    .nav-links.open { display: flex; }
    .nav-links li a {
        display: block; padding: 1rem 2rem;
        border-bottom: 1px solid var(--border-color);
        /* Min 48px touch target */
        min-height: 48px; display: flex; align-items: center;
    }
    .nav-links a.active::after { display: none; }
    .hero { padding: 3.5rem 1.5rem 3rem; }
    .hero h1 { font-size: 1.85rem; }
    .hero p { font-size: 1.05rem; }
    .features-grid { grid-template-columns: 1fr; }
    .steps-grid { grid-template-columns: 1fr; }
    .provider-card { grid-template-columns: 1fr; text-align: center; }
    .provider-preview { flex-direction: column; text-align: center; }
    .section-heading { font-size: 1.5rem; }
    .condition-tags { gap: 0.5rem; }
    .condition-tag { font-size: 0.85rem; padding: 0.5rem 1rem; min-height: 44px; display: inline-flex; align-items: center; }
    .empathy-section { padding: 2rem 1.5rem; }

    /* Cards: reduce padding on mobile */
    .card { padding: 1.5rem; }

    /* CTA section: tighten on mobile */
    .cta-section { padding: 2.5rem 1.5rem; border-radius: 16px; margin: 2rem 0; }
    .cta-section h2 { font-size: 1.5rem; }
    .cta-section p { font-size: 1rem; }
    .cta-section .btn-primary { font-size: 1rem; padding: 0.85rem 2rem; }

    /* Answer-first block: slightly smaller on mobile */
    .answer-first { font-size: 1rem; padding: 1rem 1.25rem; }

    /* Social proof grid: single column on small screens */
    .proof-grid { grid-template-columns: 1fr 1fr; }

    /* Tables: make scrollable if needed */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* FAQ: ensure touch-friendly summary targets */
    .faq-section summary { padding: 1rem 1.25rem; min-height: 48px; }

    /* Buttons: ensure minimum touch target */
    .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }

    /* Footer: stack to single column on mobile */
    .footer-content { grid-template-columns: 1fr 1fr; }

    /* Show sticky CTA on mobile */
    .sticky-cta.visible { display: block; }
    /* Add bottom padding so footer isn't hidden behind sticky bar */
    body.has-sticky-cta { padding-bottom: 70px; }
    /* Push chat widget above sticky CTA bar so they don't overlap */
    body.has-sticky-cta .pmh-chat-widget { bottom: 80px !important; }
    body.has-sticky-cta .pmh-chat-window { bottom: 150px !important; max-height: calc(100vh - 170px) !important; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.6rem; }
    .container { padding: 1rem; }
    .card { padding: 1.25rem; }
    .nav { padding: 0.75rem 1rem; }
    .logo { font-size: 1.05rem; }

    /* Footer: full single column on small phones */
    .footer-content { grid-template-columns: 1fr; }
    .footer { padding: 2rem 1.25rem 1.5rem; }

    /* Proof grid: single column on small phones */
    .proof-grid { grid-template-columns: 1fr; }

    /* Trust bar: stack vertically */
    .trust-bar-inner { flex-direction: column; align-items: center; gap: 0.5rem; }

    /* Empathy section: tighter */
    .empathy-section { padding: 1.5rem 1.25rem; border-radius: 16px; }
    .empathy-list li { font-size: 0.95rem; padding-left: 1.5rem; }

    /* Booking form card: reduce padding */
    .card[style*="padding: 3rem"] { padding: 1.5rem !important; }

    /* Step cards: tighter */
    .step-card { padding: 1.5rem 1.25rem; }
}

/* ── Feature Card as Link ── */
.feature-card-link {
    text-decoration: none; color: inherit; display: block;
    transition: box-shadow 0.3s, border-color 0.3s;
    border: 1px solid var(--border-color);
}
.feature-card-link:hover {
    box-shadow: var(--shadow-md); border-color: var(--primary);
    color: inherit;
}
.feature-card-link h3 { color: var(--primary); }

/* Desktop: never show sticky CTA */
@media (min-width: 769px) {
    .sticky-cta { display: none !important; }
}
