/**
 * Multi-Tenant Theme Styles
 * Neutral CSS custom properties — actual brand colors set by branding-loader.js
 */

/* ============================================
   CSS CUSTOM PROPERTIES (Theme Variables)
   ============================================ */
:root {
    /* Brand colors — neutral until branding-loader.js sets them */
    --brand-primary: transparent;
    --brand-accent: transparent;
    --brand-surface: #f9fafb;
    --brand-border: #e5e7eb;
    /* GoRoute sets body copy in midnight; it draws no distinction between the
       ink and body-text roles, so both default to the same value. A brand that
       does distinguish them overrides --brand-text with its own body colour. */
    --brand-text: #102D47;

    /* Wider palette. Set per-tenant from settings.branding.tokens (see
       js/brand-theme.js); these are the GoRoute defaults. A brand that
       reserves its green strictly for success states overrides --brand-success
       without touching --brand-primary. */
    --brand-ink: #102D47;
    --brand-deep-ink: #081738;
    --brand-card: #ffffff;
    --brand-success: #3cd278;
    --brand-error: #ef4444;
    --brand-warning: #f59e0b;

    /* Typography — overridable per tenant. */
    --brand-font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --brand-font-display: var(--brand-font-body);

    /* Legacy aliases — point to brand variables. Hover/glow are overridden at
       runtime by branding-loader.js (derived from the tenant primary_color);
       these are only the pre-paint fallbacks. */
    --color-primary: var(--brand-primary, #64748b);
    --color-primary-hover: #475569;
    --color-primary-glow: rgba(100, 116, 139, 0.3);
    --color-secondary: var(--brand-accent, #6b7280);
    --color-success: var(--brand-success);

    /* Text Colors */
    --color-midnight: #102D47;
    --color-grey: #668199;
    
    /* Border & Background */
    --color-border: #CCD7E1;
    --color-section: #F8FAFC;
    --color-skyblue: #C0D5FB;
    
    /* Dark Mode Colors */
    --color-darkmode: #081738;
    --color-darklight: #000f30;
    --color-dark-border: #224767;
    
    /* Shadows */
    --shadow-sm: 0px 3px 20px 0px rgba(142, 156, 169, 0.05);
    --shadow-md: 0px 10px 40px 0px rgba(104, 117, 141, 0.1);
    --shadow-lg: 0px 20px 80px 0px rgba(104, 117, 141, 0.15);
    --shadow-dashboard: 0px 20px 80px 0px rgba(104, 117, 141, 0.25);
    
    /* Dark Mode Shadows */
    --shadow-sm-dark: 0px 3px 20px 0px rgba(0, 0, 0, 0.3);
    --shadow-md-dark: 0px 10px 40px 0px rgba(100, 116, 139, 0.15);
    --shadow-lg-dark: 0px 20px 80px 0px rgba(100, 116, 139, 0.2);
}

/* ============================================
   BASE STYLES
   ============================================ */
/* Display face applies to headings only — never body or captions. */
h1, h2 {
    font-family: var(--brand-font-display);
}

body {
    font-family: var(--brand-font-body);
    background-color: #ffffff;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Pages mark their default dark text with `.text-midnight`, which now resolves
   to the ink token. Ink is the heading/dark-section role, so body copy is
   pulled back to the body-text token. Elements that opt into `.text-midnight`
   themselves still get ink, and the `.dark` variants still win in dark mode. */
body.text-midnight {
    color: var(--brand-text);
}

/* Display face on headings only — never body or captions. */
h1,
h2 {
    font-family: var(--brand-font-display);
}

/* Accessibility: ensure comfortable touch targets on phones/tablets (WCAG 2.5.5).
   Applies only to coarse pointers so desktop density is unchanged. */
@media (pointer: coarse) {
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea,
    button,
    .btn-primary,
    .btn-outline,
    a[role="button"] {
        min-height: 44px;
    }
}

.dark body, html.dark body {
    background-color: #0a1628;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, var(--brand-primary, #6b7280) 0%, #3cd278 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    background: var(--color-primary);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 20px var(--color-primary-glow);
}

.btn-outline {
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav-blur {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

.dark .nav-blur {
    background: rgba(10, 22, 40, 0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.nav-blur.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dark .nav-blur.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ============================================
   CARDS
   ============================================ */
.service-card {
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px 0 rgba(16, 45, 71, 0.06), 0 4px 16px -2px rgba(16, 45, 71, 0.10);
    border: 1px solid #E2E8F0 !important;
}

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

.service-card:hover {
    box-shadow: 0 4px 8px 0 rgba(16, 45, 71, 0.08), 0 20px 40px -8px rgba(16, 45, 71, 0.18);
    transform: translateY(-4px);
    border-color: #CBD5E1 !important;
}

.dark .service-card:hover {
    box-shadow: var(--shadow-lg-dark);
}

.dashboard-shadow {
    box-shadow: var(--shadow-dashboard);
}

/* ============================================
   PRICING
   ============================================ */
.pricing-popular {
    background: linear-gradient(135deg, var(--brand-primary, #64748b) 0%, var(--brand-accent, #64748b) 100%);
}

/* ============================================
   SECTION ELEMENTS
   ============================================ */
.section-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-success);
}

.counter-item {
    text-align: center;
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 1rem;
    padding: 2rem 1.25rem;
    box-shadow: 0 1px 3px 0 rgba(16, 45, 71, 0.06), 0 4px 16px -2px rgba(16, 45, 71, 0.10);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.counter-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px 0 rgba(16, 45, 71, 0.08), 0 20px 40px -8px rgba(16, 45, 71, 0.18);
}

.dark .counter-item {
    background: var(--color-darkmode);
    border-color: var(--color-dark-border);
    box-shadow: var(--shadow-sm-dark);
}

.dark .counter-item:hover {
    box-shadow: var(--shadow-lg-dark);
}

/* ============================================
   CERTIFICATION BADGES (footer)
   White pill cards so colored logos read clearly on dark footer.
   ============================================ */
.cert-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 0.875rem 1.25rem;
    height: 88px;
    width: 132px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.10);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cert-badge--wide {
    width: 168px;
}

.cert-badge img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.cert-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.30), 0 2px 6px rgba(0, 0, 0, 0.15);
}

@media (min-width: 768px) {
    .cert-badge        { height: 100px; width: 156px; padding: 1rem 1.5rem; }
    .cert-badge--wide  { width: 200px; }
}
/* ============================================
   FAQ ACCORDION
   ============================================ */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
}

.dark .faq-item {
    background-color: var(--color-darklight);
    border-color: var(--color-dark-border);
}

.dark .faq-item:hover {
    box-shadow: var(--shadow-md-dark);
}

.dark .faq-item button span {
    color: white;
}

.dark .faq-item div p,
.dark .faq-item div li {
    color: #9ca3af;
}

.dark .faq-item div strong {
    color: #d1d5db;
}

/* ============================================
   DARK MODE TOGGLE BUTTON
   ============================================ */
.theme-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid var(--color-border);
}

.theme-toggle:hover {
    background: var(--color-section);
    border-color: var(--color-primary);
}

.dark .theme-toggle {
    border-color: var(--color-dark-border);
}

.dark .theme-toggle:hover {
    background: #0f2847;
    border-color: var(--color-primary);
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

.dark .theme-toggle .sun-icon {
    display: none;
}

.dark .theme-toggle .moon-icon {
    display: block;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.transition-theme {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ============================================
   MOBILE RESPONSIVE IMPROVEMENTS
   ============================================ */

/* Improve touch targets on mobile */
@media (max-width: 640px) {
    .btn-primary, .btn-outline {
        min-height: 44px;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Better footer spacing on mobile */
    footer h4 {
        font-size: 0.9rem;
    }
    
    footer ul li a {
        padding: 0.25rem 0;
        display: inline-block;
    }
    
    /* Improve readability on small screens */
    .faq-item button {
        padding: 1rem;
    }
    
    .faq-item button span {
        font-size: 0.9rem;
    }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
    footer h4 {
        font-size: 0.95rem;
    }
}

/* Ensure proper text wrapping */
footer a {
    word-break: break-word;
}

/* ============================================
   FLOATING CTA BUTTON
   ============================================ */
.floating-cta {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 50px;
    box-shadow: 0 4px 20px var(--color-primary-glow);
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.floating-cta.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.floating-cta:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 6px 28px var(--color-primary-glow);
    transform: translateY(-2px);
}
.floating-cta svg {
    flex-shrink: 0;
}
@media (max-width: 640px) {
    .floating-cta {
        bottom: 16px;
        right: 16px;
        padding: 10px 16px;
        font-size: 0.8125rem;
    }
}

