/* ============================================
   DESIGN SYSTEM — Bold & Modern (Template 3)
   Cabinet de Psihologie
   ============================================ */

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

:root {
    /* Colors */
    --navy: #1a1a2e;
    --navy-light: #2d2d44;
    --navy-lighter: #3d3d5c;
    --navy-80: rgba(26,26,46,0.8);
    --gold: #c9a84c;
    --gold-dark: #b8963e;
    --gold-light: #e8d5a0;
    --gold-pale: #f9f3e3;
    --slate: #6b7280;
    --slate-light: #9ca3af;
    --slate-200: #e5e7eb;
    --off-white: #f9fafb;
    --white: #ffffff;
    --green: #22c55e;
    --red: #ef4444;
    --bg: #ffffff;

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;

    /* Spacing */
    --section-py: 80px;
    --container-max: 1180px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(26,26,46,0.06);
    --shadow-md: 0 8px 24px rgba(26,26,46,0.08);
    --shadow-lg: 0 16px 40px rgba(26,26,46,0.12);

    /* Transitions */
    --transition: all 0.3s ease;

    /* Accessible gold for text on white (WCAG AA 4.5:1 contrast) */
    --gold-accessible: #8a7230;

    /* Navy-bg: always dark, used for hero/footer/icons backgrounds */
    --navy-bg: #1a1a2e;
    --navy-bg-light: #2d2d44;

    /* Alert / info colors (light mode defaults) */
    --flash-success-bg: #dcfce7;
    --flash-success-text: #166534;
    --flash-error-bg: #fef2f2;
    --flash-error-text: #991b1b;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;
    --info-text: #1e40af;
    --warning-bg: #fef3c7;
    --warning-border: #fecaca;
    --warning-text: #92400e;
}

/* === DARK MODE === */
/*
 * Strategy: do NOT flip --navy (used as bg for hero, footer, urgency, page-hero, icons).
 * Only flip light-side vars (--white, --off-white, --bg, --slate-200).
 * Handle text color changes via explicit selectors.
 */
html.dark {
  --navy:#f1f5f9;--navy-light:#e2e8f0;--navy-lighter:#cbd5e1;
  /* --navy-bg stays #1a1a2e (never flips) — hero, footer, icons keep dark bg */
  --gold:#e8d5a0;--gold-dark:#c9a84c;--gold-light:rgba(201,168,76,.2);--gold-pale:rgba(201,168,76,.08);
  --gold-accessible:#e8d5a0;
  --slate:#b0bec5;--slate-light:#78909c;--slate-200:#334155;
  --off-white:#1e293b;--white:#1e293b;--bg:#0f172a;
  --shadow-sm:0 2px 8px rgba(0,0,0,.4);--shadow-md:0 8px 24px rgba(0,0,0,.45);--shadow-lg:0 16px 40px rgba(0,0,0,.55);
  --flash-success-bg:#052e16;--flash-success-text:#86efac;
  --flash-error-bg:#450a0a;--flash-error-text:#fca5a5;
  --info-bg:#1e293b;--info-border:#334155;--info-text:#cbd5e1;
  --warning-bg:#451a03;--warning-border:#78350f;--warning-text:#fbbf24;
}

/* --- Body & page background --- */
html.dark body { background:var(--bg); color:#f1f5f9; }

/* --- Header & nav --- */
html.dark .header { background:#0f172a !important; border-color:#334155; }
html.dark .logo { color:#f1f5f9; }
html.dark .nav a { color:#cbd5e1; }
html.dark .nav a:hover, html.dark .nav a.active { color:#e8d5a0; }
html.dark .nav-cta { background:#f1f5f9 !important; color:#0f172a !important; }
html.dark .nav.open { background:#0f172a; border-color:#334155; }
html.dark .menu-toggle span { background:#f1f5f9; }
html.dark .lang-switcher a { color:#94a3b8; }
html.dark .lang-switcher a.active-lang { background:#f1f5f9; color:#0f172a; }

/* --- Typography --- */
html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5 { color:#f1f5f9; }
html.dark p { color:#e2e8f0 !important; }
html.dark .card p { color:#e2e8f0 !important; }
html.dark [style*="color:var(--slate)"] { color:#e2e8f0 !important; }
html.dark .overline { color:#94a3b8; }
html.dark .section-dark .overline, html.dark .page-hero .overline { color:var(--gold); }

/* --- Sections --- */
html.dark .section { background:#0f172a; }
html.dark .section-alt { background:#111827; }
html.dark .section-gold { background:rgba(201,168,76,.08); }
html.dark .section-dark { background:#1a1a2e; }
html.dark .page-hero { background:#1a1a2e; }
html.dark .home-hero { background:#1a1a2e !important; }
html.dark .breadcrumb { background:#0f172a; border-color:#334155; }
html.dark section { border-color:#334155; }

/* --- Cards --- */
html.dark .card,
html.dark .service-card,
html.dark .testimonial-card,
html.dark .team-card,
html.dark .blog-card,
html.dark .faq-item,
html.dark .pricing-card {
  background:#1e293b; border-color:#334155; color:#f1f5f9;
}
html.dark .card:hover { border-color:#e8d5a0; }
html.dark a.card { color:#f1f5f9; }
html.dark a.card:hover { color:#f1f5f9; }
html.dark .card-dark { background:rgba(255,255,255,.05); border-color:rgba(255,255,255,.08); }

/* --- Buttons --- */
html.dark .btn-navy { background:#f1f5f9; color:#0f172a; }
html.dark .btn-navy:hover { background:#e2e8f0; color:#0f172a; }
html.dark .btn-outline { color:#f1f5f9; border-color:#94a3b8; }
html.dark .btn-outline:hover { background:#f1f5f9; color:#0f172a; }
html.dark .btn-outline-white { color:rgba(255,255,255,.8); border-color:rgba(255,255,255,.3); }
html.dark .btn-white { background:#1e293b; color:#f1f5f9; border-color:#334155; }
html.dark .btn-white:hover { background:#334155; }

/* --- Forms --- */
html.dark input, html.dark select, html.dark textarea { background:#1e293b; color:#f1f5f9; border-color:#475569; }
html.dark .input { background:#1e293b; color:#f1f5f9; border-color:#475569; }
html.dark .input:focus { border-color:#e8d5a0; box-shadow:0 0 0 3px rgba(201,168,76,.15); }
html.dark .form-label { color:#cbd5e1; }
html.dark .form-input::placeholder, html.dark .form-textarea::placeholder { color:#64748b; }
html.dark .form-hint { color:#64748b; }

/* --- Tables --- */
html.dark table { color:#f1f5f9; }
html.dark td { border-color:#334155; }
html.dark th { border-color:#334155; }
html.dark .price-table td { border-color:#334155; color:#f1f5f9; }
html.dark .price-table tr:hover td { background:rgba(201,168,76,.1); }
html.dark .price-value { color:#e8d5a0; }

/* --- Tags & badges --- */
html.dark .tag { background:#334155; color:#cbd5e1; }
html.dark .tag-gold { background:rgba(201,168,76,.15); color:#e8d5a0; }
html.dark .tag-navy { background:#1a1a2e; color:#e8d5a0; }

/* --- Blog --- */
html.dark .blog-card-body { background:#1e293b; }
html.dark .blog-meta { color:#64748b; }

/* --- Testimonials --- */
html.dark .test-service { color:#e8d5a0; }

/* --- FAQ --- */
html.dark .faq-question { color:#f1f5f9; }
html.dark .faq-answer-inner { color:#94a3b8; }

/* --- Footer (already dark, keep as-is) --- */
html.dark .footer { background:#1a1a2e !important; }
html.dark .footer-brand { color:#f1f5f9; }
html.dark .footer h4 { color:#f1f5f9; }

/* --- Urgency bar (already dark, keep as-is) --- */
html.dark .urgency-bar { background:#1a1a2e; }

/* --- Misc --- */
html.dark .mobile-nav, html.dark .mobile-menu { background:#1e293b; }
html.dark #cookieBanner { background:#1e293b !important; }
html.dark .map-container { background:#1e293b; border-color:#334155; }
html.dark .empty-state { color:#94a3b8; }
html.dark .empty-state h3 { color:#f1f5f9; }
html.dark .skeleton { background:#334155; }

/* Dark mode toggle */
.theme-toggle {
  background:none; border:none; cursor:pointer; padding:6px;
  color:inherit; display:inline-flex; align-items:center; justify-content:center;
  border-radius:8px; transition:background .2s; vertical-align:middle;
}
.theme-toggle:hover { background:rgba(128,128,128,.15); }
.theme-toggle svg { width:20px; height:20px; }
.theme-toggle .icon-sun { display:none; }
html.dark .theme-toggle .icon-sun { display:block; }
html.dark .theme-toggle .icon-moon { display:none; }

html { overflow-x: hidden; }

body {
    font-family: var(--font-body);
    color: var(--navy);
    background: var(--bg);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5 { font-family: var(--font-heading); line-height: 1.2; }
h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

p { max-width: 680px; }
a { color: var(--gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-dark); }

.overline {
    font-family: var(--font-body);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold-accessible);
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}
/* Overline on dark backgrounds keeps original gold (good contrast on dark) */
.section-dark .overline,
.page-hero .overline { color: var(--gold); }

/* === LAYOUT === */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }
.section { padding: var(--section-py) 24px; }
.section-dark { background: var(--navy-bg); color: #fff; }
.section-alt { background: var(--off-white); }
.section-gold { background: var(--gold-pale); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-6 { margin-bottom: 48px; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }

/* === BUTTONS === */
.btn {
    display: inline-block;
    padding: 15px 32px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    line-height: 1;
}
.btn-gold { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: var(--navy); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(201,168,76,0.4); }
.btn-navy { background: var(--navy-bg); color: #fff; border-color: var(--navy-bg); }
.btn-navy:hover { background: var(--navy-bg-light); border-color: var(--navy-bg-light); color: #fff; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-outline-white { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.3); }
.btn-outline-white:hover { border-color: var(--white); background: rgba(255,255,255,0.1); color: var(--white); }
.btn-outline-gold { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-outline-gold:hover { background: var(--gold); color: var(--navy); }
.btn-white { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn-white:hover { background: var(--off-white); color: var(--navy); box-shadow: var(--shadow-md); }
.btn-sm { padding: 10px 20px; font-size: 0.82rem; }
.btn-lg { padding: 18px 40px; font-size: 0.92rem; }

/* === URGENCY BANNER === */
.urgency-bar {
    background: var(--navy-bg);
    color: #cbd5e1;
    text-align: center;
    padding: 8px 16px;
    font-size: 0.78rem;
    letter-spacing: 0.3px;
}
.urgency-bar a { color: #e8d5a0; font-weight: 600; }

/* === HEADER === */
.header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--slate-200);
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    max-width: var(--container-max);
    margin: 0 auto;
}
.logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy);
    text-decoration: none;
    letter-spacing: -0.5px;
    flex-shrink: 0;
    margin-right: 24px;
}
.logo-dot { color: var(--gold); }

.nav { display: flex; gap: 20px; align-items: center; }
.nav a {
    color: var(--slate);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}
.nav a:hover { color: var(--navy); }
.nav a.active { color: var(--navy); font-weight: 700; }
.nav-cta {
    background: var(--navy-bg);
    color: #fff !important;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.nav-cta:hover { background: var(--navy-bg-light); }

/* Mobile menu toggle */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--navy); margin: 5px 0; transition: var(--transition); }

/* === PAGE HERO (interior pages) === */
.page-hero {
    background: var(--navy-bg);
    color: #fff;
    padding: 60px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    max-width: 100vw;
}
.page-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(201,168,76,0.06) 0%, transparent 70%);
    border-radius: 50%;
}
.page-hero h1 { color: #fff; margin-bottom: 16px; position: relative; z-index: 2; }
.page-hero p { color: var(--slate-light); max-width: 560px; margin: 0 auto; font-size: 1.05rem; position: relative; z-index: 2; }
.page-hero .overline { position: relative; z-index: 2; }

/* === BREADCRUMB === */
.breadcrumb {
    padding: 16px 24px;
    font-size: 0.82rem;
    color: var(--slate-light);
    border-bottom: 1px solid var(--slate-200);
}
.breadcrumb a { color: var(--slate); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .separator { margin: 0 8px; color: var(--slate-200); }

/* === CARDS === */
.card {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 32px;
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--gold);
}
.card-dark {
    background: var(--navy-light);
    border-color: rgba(255,255,255,0.05);
    color: var(--white);
}
.card-dark:hover { border-color: var(--gold); }

/* === TAGS === */
.tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tag-gold { background: var(--gold-pale); color: var(--gold-accessible); }
.tag-navy { background: var(--navy-bg); color: #fff; }

/* === SECTION HEADER === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}
.section-header p { color: var(--slate); max-width: 400px; }

/* === SERVICE CARDS (numbered) === */
.svc-num {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold-light);
    display: block;
    margin-bottom: 16px;
    transition: var(--transition);
}
.card:hover .svc-num { color: var(--gold); }
.svc-arrow { margin-top: 16px; font-size: 1.2rem; color: var(--gold); transition: var(--transition); display: block; }
.card:hover .svc-arrow { transform: translateX(6px); }

/* === TESTIMONIALS === */
.test-stars {
    color: var(--gold);
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-bottom: 16px;
}
.test-quote {
    font-size: 0.95rem;
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 20px;
}
.test-author { font-weight: 600; font-size: 0.9rem; }
.test-service { font-size: 0.8rem; color: var(--gold-accessible); }

/* === BLOG CARDS === */
.blog-thumb {
    width: 100%;
    height: 200px;
    background: var(--off-white);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate);
    font-size: 0.85rem;
    overflow: hidden;
}
.blog-card { border-radius: var(--radius-md); overflow: hidden; text-decoration: none; color: inherit; display: block; }
.blog-card:hover { color: inherit; }
.blog-card-body { padding: 20px; }
.blog-meta { font-size: 0.78rem; color: var(--slate-light); margin-bottom: 8px; }
.blog-card h3 { font-size: 1.05rem; margin-bottom: 6px; transition: var(--transition); }
.blog-card:hover h3 { color: var(--gold); }

/* === PRICING TABLE === */
.price-table { width: 100%; border-collapse: collapse; }
.price-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--navy-bg);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.price-table td {
    padding: 16px;
    border-bottom: 1px solid var(--slate-200);
    font-size: 0.92rem;
}
.price-table tr:hover td { background: var(--gold-pale); }
.price-value { font-weight: 700; color: var(--navy); font-size: 1rem; }

/* === FORMS === */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--navy);
    background: var(--white);
    transition: var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}
.form-input:focus-visible, .form-textarea:focus-visible, .form-select:focus-visible {
    outline: 2px solid var(--gold-accessible);
    outline-offset: 2px;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,.2);
}
.form-textarea { min-height: 140px; resize: vertical; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--slate); }
.form-checkbox { display: flex; align-items: start; gap: 10px; font-size: 0.88rem; color: var(--slate); }
.form-checkbox input { margin-top: 4px; accent-color: var(--gold); }
.form-error { font-size: 0.8rem; color: var(--red); margin-top: 4px; }
.form-hint { font-size: 0.8rem; color: var(--slate-light); margin-top: 4px; }

/* === FAQ ACCORDION === */
.faq-item { border-bottom: 1px solid var(--slate-200); }
.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--navy);
    transition: var(--transition);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}
.faq-question:hover { color: var(--gold); }
.faq-icon {
    font-size: 1.4rem;
    color: var(--gold);
    transition: var(--transition);
    flex-shrink: 0;
    margin-left: 16px;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer { max-height: 500px; }
.faq-answer-inner {
    padding: 0 0 20px;
    color: var(--slate);
    font-size: 0.95rem;
    line-height: 1.8;
}

/* === GOOGLE MAP === */
.map-container {
    width: 100%;
    height: 400px;
    background: var(--off-white);
    border: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate);
    font-size: 0.9rem;
}

/* === FOOTER === */
.footer {
    background: var(--navy-bg);
    color: rgba(255,255,255,0.6);
    padding: 56px 24px 32px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
    gap: 40px;
    max-width: var(--container-max);
    margin: 0 auto;
}
.footer-brand { font-family: var(--font-heading); font-size: 1.4rem; color: var(--white); font-weight: 700; margin-bottom: 12px; }
.footer h4 {
    color: var(--white);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    font-family: var(--font-body);
    font-weight: 600;
}
.footer ul { list-style: none; }
.footer li { margin-bottom: 10px; }
.footer a { color: rgba(255,255,255,0.6); font-size: 0.88rem; }
.footer a:hover { color: var(--gold-light); }
.footer-bottom {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    font-size: 0.8rem;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
}
.footer-bottom a { margin: 0 8px; }

/* === WHATSAPP FAB === */
.whatsapp-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 16px rgba(37,211,102,0.35);
    text-decoration: none;
    z-index: 999;
    transition: transform 0.2s;
}
.whatsapp-fab:hover { transform: scale(1.1); color: white; }

/* === UTILITIES === */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-gold { color: var(--gold); }
.text-slate { color: var(--slate); }
.text-white { color: var(--white); }
.bg-navy { background: var(--navy-bg); }
.bg-gold-pale { background: var(--gold-pale); }
.highlight { color: var(--gold); font-style: italic; }
.divider { height: 1px; background: var(--slate-200); margin: 40px 0; }
.divider-dark { height: 1px; background: rgba(255,255,255,0.08); margin: 40px 0; }

/* === RESPONSIVE === */

/* --- Tablet (max 1024px) --- */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }

    /* About therapist card — stack */
    [style*="grid-template-columns:300px"],
    [style*="grid-template-columns: 300px"] {
        grid-template-columns: 1fr !important;
    }

    /* Contact page grid — stack */
    [style*="grid-template-columns:1.2fr 1fr"],
    [style*="grid-template-columns: 1.2fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }

    /* Footer — 2 columns */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }

    /* Tables — horizontal scroll */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Home hero — stack */
    .home-hero [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* --- Mobile (max 768px) — Main breakpoint --- */
@media (max-width: 768px) {
    :root { --section-py: 48px; }

    /* Navigation */
    .nav { display: none; }
    .nav.open {
        display: flex; flex-direction: column; position: absolute;
        top: 100%; left: 0; right: 0; background: var(--white);
        padding: 24px; border-bottom: 1px solid var(--slate-200);
        box-shadow: var(--shadow-md); z-index: 200;
    }
    .nav.open a { padding: 8px 0; font-size: 1rem; }
    .menu-toggle { display: block; }

    /* Grid classes */
    .grid-2 { grid-template-columns: 1fr !important; gap: 24px !important; }
    .grid-3 { grid-template-columns: 1fr !important; }
    .grid-4 { grid-template-columns: 1fr 1fr !important; }

    /* Typography */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    .page-hero { padding: 36px 16px; }
    .page-hero p { font-size: 0.95rem; }

    /* Buttons */
    .btn-lg { padding: 14px 28px; font-size: 0.85rem; }

    /* Cards — reduce padding on mobile */
    .card { padding: 20px; }

    /* Section header */
    .section-header { flex-direction: column; gap: 16px; align-items: flex-start; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }

    /* ======================================
       INLINE STYLE OVERRIDES FOR CMS VIEWS
       (views use inline grids that need !important)
       ====================================== */

    /* Hero grids (home.php: 1.3fr 1fr) */
    .home-hero [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    /* All inline 2-column grids → single column */
    [style*="grid-template-columns:1.2fr 1fr"],
    [style*="grid-template-columns: 1.2fr 1fr"],
    [style*="grid-template-columns:1.3fr 1fr"],
    [style*="grid-template-columns: 1.3fr 1fr"],
    [style*="grid-template-columns:300px"],
    [style*="grid-template-columns: 300px"] {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    /* All inline repeat(2) and repeat(3) grids */
    [style*="grid-template-columns:repeat(2"],
    [style*="grid-template-columns: repeat(2"],
    [style*="grid-template-columns:repeat(3"],
    [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
    }

    /* 2-column form grids → stack */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Flex containers that need to stack */
    [style*="display:flex"][style*="gap:48px"],
    [style*="display: flex"][style*="gap: 48px"],
    [style*="display:flex"][style*="gap:40px"],
    [style*="display: flex"][style*="gap: 40px"] {
        flex-direction: column !important;
        gap: 24px !important;
    }

    /* Reduce excessive inline padding */
    [style*="padding:40px"],
    [style*="padding: 40px"] {
        padding: 20px !important;
    }
    [style*="padding:32px"],
    [style*="padding: 32px"] {
        padding: 20px !important;
    }

    /* Featured blog article grid → stack */
    [style*="min-height:300px"] {
        min-height: 200px !important;
    }

    /* Image grid in hero — hide on mobile */
    [aria-hidden="true"][style*="grid-template-columns:1fr 1fr"] {
        display: none !important;
    }

    /* Tables — horizontal scroll */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Map container — shorter on mobile */
    .map-container { height: 250px; }
    iframe[style*="height:400"] { height: 250px !important; }

    /* Cookie banner — stack buttons */
    #cookieBanner [style*="justify-content:space-between"] {
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* Newsletter form — stack */
    form[style*="display:flex"][style*="gap:12px"] {
        flex-direction: column !important;
    }

    /* Social share buttons — wrap better */
    [style*="display:flex"][style*="gap:12px"][style*="border-top"] {
        flex-wrap: wrap !important;
    }

    /* 404 page — smaller number */
    [style*="font-size:8rem"] { font-size: 4rem !important; }

    /* Dashboard — all repeat(3) grids to 1 column (stats, quick actions, file) */
    [style*="grid-template-columns:repeat(3"],
    [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
    }

    /* Dashboard next appointment — stack flex layout */
    [style*="display:flex"][style*="justify-content:space-between"][style*="align-items:center"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    /* Service detail — info bar wrap */
    [style*="display:flex"][style*="gap:24px"][style*="padding:20px"] {
        flex-wrap: wrap !important;
        gap: 12px !important;
    }

    /* Home hero — center text */
    .home-hero { text-align: center; }
    .home-hero p { margin-left: auto; margin-right: auto; }

    /* Hero buttons — center */
    [style*="display:flex"][style*="gap:16px"][style*="flex-wrap:wrap"] {
        justify-content: center !important;
    }

    /* Blog article — padding on small screens */
    article [style*="max-width:720px"] {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    article [style*="max-width:900px"] {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Booking submit button — full width */
    #submitBtn { min-width: auto !important; width: 100%; }

    /* Language switcher — wrap in mobile nav */
    .nav.open .lang-switcher { margin-top: 8px; }

    /* Max-width containers — add breathing room */
    [style*="max-width:1000px"],
    [style*="max-width: 1000px"],
    [style*="max-width:900px"],
    [style*="max-width: 900px"],
    [style*="max-width:800px"],
    [style*="max-width: 800px"] {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* --- Small phones (max 480px) --- */
@media (max-width: 480px) {
    .grid-4 { grid-template-columns: 1fr !important; }
    .footer-grid { grid-template-columns: 1fr !important; }

    /* Even tighter spacing */
    .section { padding: 36px 16px; }
    .card { padding: 16px; }
    .btn { padding: 12px 20px; font-size: 0.82rem; }
    .btn-lg { padding: 12px 24px; }

    /* Pricing table — readable */
    .price-table td, .price-table th { padding: 10px 8px; font-size: 0.8rem; }

    /* FAQ — smaller font */
    .faq-question { font-size: 0.95rem; padding: 16px 0; }
}

/* --- Very small phones (max 360px) --- */
@media (max-width: 360px) {
    body { font-size: 15px; }
    .header-inner { padding: 12px 12px; }
    .section { padding: 28px 12px; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    .footer { padding: 40px 12px 24px; }
}

/* === UI DESIGNER FIXES === */

/* Disabled button styles */
.btn-gold:disabled, .btn-navy:disabled, .btn-outline:disabled, .btn:disabled {
    opacity: 0.5; cursor: not-allowed; pointer-events: none;
}
input:disabled, select:disabled, textarea:disabled {
    opacity: 0.6; background: var(--off-white); cursor: not-allowed;
}

/* FAQ focus state */
.faq-question:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}

/* Loading skeleton */
.skeleton { background: var(--slate-200); border-radius: var(--radius-md); animation: skeleton-pulse 1.5s ease-in-out infinite; }
@keyframes skeleton-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; color: var(--slate); }
.empty-state h3 { color: var(--navy); font-size: 1.2rem; margin-bottom: 8px; }

/* === ACCESSIBILITY: Focus-visible styles === */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--primary, #7c3aed);
    outline-offset: 2px;
}

/* === ACCESSIBILITY: Touch targets for radio & checkbox === */
input[type="radio"], input[type="checkbox"] {
    min-width: 20px;
    min-height: 20px;
}
label:has(input[type="radio"]), label:has(input[type="checkbox"]) {
    padding: 8px 12px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
