/* ==========================================================================
   APPLICARE V2 — DESIGN SYSTEM
   Derived from logo: rounded teardrop, bubbly type, professional teal
   Font: Plus Jakarta Sans (matches logo's rounded personality)
   ========================================================================== */

/* --- TOKENS --- */
:root {
    /*
     * ── BRAND TOKEN SSOT POINTER (Track 7, ADR 0052) ──────────────────────────
     * The canonical upstream source for brand color tokens is the CRM repo:
     *   /resources/css/generated/tokens.css  (generated from design-tokens/color.json)
     *   /design-tokens/color.json            (source of truth — edit here, regenerate)
     *
     * CRM canonical mapping (ADR 0052):
     *   --colors-brand / --colors-primary  →  #2D8783  ✓ matches --brand below
     *   --colors-primary-dark              →  #1e5f5c  ✓ matches --brand-dark below
     *   --colors-primary-light             →  #3fa39e  ✓ matches --brand-light below
     *
     * ⚠ BRAND DIVERGENCE — REQUIRES DESIGN DECISION:
     *   --accent: #FF6B35 (orange, used on CTAs and highlights throughout this site)
     *   has NO counterpart in the CRM Track-7 design tokens (color.json / tokens.css).
     *   This is a REAL brand split between the marketing site and the admin/app product.
     *   Do NOT auto-map it to any CRM token — it may intentionally exist only here.
     *   ACTION REQUIRED: design + brand review to decide whether to:
     *     (a) add --accent / orange to CRM design-tokens/color.json (unifies both surfaces)
     *     (b) keep it marketing-site-only (document as intentional divergence in ADR 0052)
     *   Until that decision lands, DO NOT change the #FF6B35 value below.
     * ──────────────────────────────────────────────────────────────────────────
     */

    /* Brand — extracted from logo */
    --brand: #2D8783;
    --brand-light: #3BA39F;
    --brand-lighter: #E8F6F5;
    --brand-dark: #1F6461;
    --brand-mid: #166460;
    --brand-deep: #0D4A46;
    --brand-glow: rgba(45, 135, 131, 0.15);

    /* Accent — complementary to teal */
    --accent: #FF6B35;
    --accent-light: #FF8A5C;
    --accent-dark: #E85D2C;
    --accent-glow: rgba(255, 107, 53, 0.15);

    /* Neutrals — warm, not cold */
    --navy: #0F1B2D;
    --navy-light: #162338;
    --text-primary: #1A2332;
    --text-secondary: #5A6B7F;
    --text-tertiary: #8896A7;
    --border: #E2E8F0;
    --border-light: #F0F4F8;
    --surface: #F7FAFA;
    --surface-warm: #FAFCFB;
    --white: #FFFFFF;

    /* Semantic */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Typography */
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Sizing scale (rem-based for accessibility) */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.8125rem;  /* 13px */
    --text-base: 0.9375rem;/* 15px */
    --text-md: 1rem;       /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 1.875rem;  /* 30px */
    --text-4xl: 2.25rem;   /* 36px */
    --text-5xl: 3rem;      /* 48px */

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;
    --space-24: 96px;

    /* Radii — 8px base for cards (research-backed), pill for CTAs/badges */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-pill: 100px;
    --radius-round: 50%;

    /* Shadows — soft, layered (no harsh edges) */
    --shadow-xs: 0 1px 2px rgba(15, 27, 45, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 27, 45, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 27, 45, 0.08);
    --shadow-lg: 0 8px 30px rgba(15, 27, 45, 0.1);
    --shadow-xl: 0 16px 50px rgba(15, 27, 45, 0.12);
    --shadow-brand: 0 4px 20px rgba(45, 135, 131, 0.25);
    --shadow-accent: 0 4px 20px rgba(255, 107, 53, 0.25);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration: 0.25s;
    --duration-slow: 0.4s;

    /* Layout */
    --container-max: 1200px;
    --container-narrow: 800px;
    --header-height: 80px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--duration) var(--ease);
}

ul, ol { list-style: none; }

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

/* --- LAYOUT --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-8);
}

.container-narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 var(--space-8);
}

section {
    padding: var(--space-24) 0;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    line-height: 1.2;
    font-weight: 700;
}

h1 { font-size: var(--text-5xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-4xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-lg); font-weight: 600; }

p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-4);
}

p:last-child { margin-bottom: 0; }

.section-label {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand);
    margin-bottom: var(--space-3);
}

.section-title {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-4);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 560px;
}

.text-center { text-align: center; }
.text-center .section-subtitle { margin: 0 auto; }

.highlight { color: var(--brand); }

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font);
    font-weight: 600;
    font-size: var(--text-base);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-pill);
    transition: all var(--duration) var(--ease);
    cursor: pointer;
    white-space: nowrap;
    border: 2px solid transparent;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-md);
}

.btn-xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-lg);
}

.btn-primary {
    background: var(--brand);
    color: var(--white);
    border-color: var(--brand);
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(45, 135, 131, 0.35);
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
}

.btn-accent:hover {
    background: #E85D2C;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-lighter);
}

.btn-white {
    background: var(--white);
    color: var(--brand);
    border-color: var(--white);
}

.btn-white:hover {
    background: var(--brand-lighter);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-ghost-white {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,0.3);
}

.btn-ghost-white:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--white);
}

/* High-contrast dark CTA — research shows dark buttons outperform brand-colored */
.btn-dark {
    background: var(--text-primary);
    color: var(--white);
    border-color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(26, 35, 50, 0.25);
}

.btn-dark:hover {
    background: var(--navy);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(26, 35, 50, 0.35);
}

.btn svg, .btn img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* --- CARDS --- */
.card {
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    padding: var(--space-8);
    transition: all var(--duration) var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}

.card-elevated {
    box-shadow: var(--shadow-sm);
}

.card-elevated:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* --- BADGES --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    font-weight: 600;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-brand {
    background: var(--brand-lighter);
    color: var(--brand-dark);
}

.badge-accent {
    background: var(--accent-glow);
    color: var(--accent);
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

/* --- UTILITY --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bg-navy { background: var(--navy); color: var(--white); }
.bg-surface { background: var(--surface); }
.bg-white { background: var(--white); }
.bg-brand-light { background: var(--brand-lighter); }

/* --- PUBLIC WEBSITE COMPONENTS --- */
.service-area-chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--brand);
    background: var(--white);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
}

.service-area-chip:hover,
.service-area-chip:focus-visible {
    border-color: var(--brand-light);
    color: var(--brand-dark);
    background: var(--brand-lighter);
    outline: none;
}

.area-tag {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    background: var(--surface-warm);
    font-size: var(--text-sm);
    font-weight: 600;
}

.faq-item {
    margin-bottom: var(--space-3);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--white);
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.faq-item:hover,
.faq-item[open] {
    border-color: rgba(45, 135, 131, 0.35);
    box-shadow: var(--shadow-sm);
}

.faq-item > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 60px;
    padding: var(--space-5) var(--space-6);
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.45;
}

.faq-item > summary::-webkit-details-marker { display: none; }

.faq-item > summary svg {
    flex-shrink: 0;
    color: var(--brand);
    transition: transform var(--duration) var(--ease);
}

.faq-item[open] > summary svg { transform: rotate(180deg); }

.faq-item > [itemprop="acceptedAnswer"] {
    padding: 0 var(--space-6) var(--space-5);
    color: var(--text-secondary);
    line-height: 1.7;
}

.trust-feature-card {
    padding: var(--space-8);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--white);
    text-align: center;
    box-shadow: var(--shadow-xs);
}

.trust-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
}

.trust-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto var(--space-4);
    border-radius: var(--radius-round);
    background: var(--brand-lighter);
    color: var(--brand-dark);
    font-size: 24px;
}

.trust-feature-title { margin-bottom: var(--space-2); }
.body-copy-sm { color: var(--text-secondary); font-size: var(--text-sm); }

/* --- SHARED FOOTER V2 --- */
.site-footer-v2 {
    padding: var(--space-16) 0 var(--space-6);
    background: var(--navy);
    color: rgba(255,255,255,0.72);
}

.footer-grid-v2 {
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(130px, 1fr));
    gap: var(--space-10);
}

.footer-brand-v2 img { margin-bottom: var(--space-5); }

.footer-brand-v2 p {
    max-width: 390px;
    margin-bottom: var(--space-4);
    color: rgba(255,255,255,0.64);
    font-size: var(--text-sm);
    line-height: 1.7;
}

.footer-brand-v2 .footer-reg-v2 {
    color: rgba(255,255,255,0.48);
    font-size: 10px;
    line-height: 1.65;
}

.site-footer-v2 h4 {
    margin-bottom: var(--space-4);
    color: var(--white);
    font-size: var(--text-sm);
    font-weight: 800;
}

.site-footer-v2 ul { margin: 0; padding: 0; list-style: none; }
.site-footer-v2 li + li { margin-top: 7px; }

.site-footer-v2 a {
    color: rgba(255,255,255,0.66);
    font-size: var(--text-xs);
    line-height: 1.45;
}

.site-footer-v2 a:hover,
.site-footer-v2 a:focus-visible { color: var(--white); }

.footer-bottom-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-10);
    padding-top: var(--space-5);
    border-top: 1px solid rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.45);
    font-size: 10px;
}

.footer-bottom-v2 a { font-size: inherit; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    :root {
        --text-5xl: 2.25rem;
        --text-4xl: 1.75rem;
        --text-3xl: 1.5rem;
        --text-2xl: 1.25rem;
    }

    .container {
        padding: 0 var(--space-5);
    }

    section {
        padding: var(--space-16) 0;
    }

    body {
        padding-bottom: 80px; /* space for mobile bottom nav */
    }

    .service-area-chip { min-height: 44px; }

    .faq-item > summary {
        min-height: 56px;
        padding: var(--space-4) var(--space-5);
        font-size: var(--text-base);
    }

    .faq-item > [itemprop="acceptedAnswer"] {
        padding: 0 var(--space-5) var(--space-5);
    }

    .trust-feature-card { padding: var(--space-6); }
    .trust-feature-grid { grid-template-columns: 1fr; gap: var(--space-4); }

    .site-footer-v2 { padding: var(--space-10) 0 var(--space-5); }
    .footer-grid-v2 { grid-template-columns: 1fr 1fr; gap: var(--space-8) var(--space-5); }
    .footer-brand-v2 { grid-column: 1 / -1; }
    .footer-bottom-v2 { flex-direction: column; align-items: flex-start; margin-top: var(--space-8); }

    /* Booking has a single task; keep its mobile footer useful and concise. */
    .booking-page .footer-grid-v2 > div:nth-child(2),
    .booking-page .footer-grid-v2 > div:nth-child(3) { display: none; }
    .booking-page .footer-grid-v2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    :root {
        --text-5xl: 1.875rem;
        --text-4xl: 1.5rem;
    }

    .container {
        padding: 0 var(--space-4);
    }

    section {
        padding: var(--space-12) 0;
    }
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
