/* ============================================
   MAIN.CSS — Horizon Prestige
   Additional styles & enhancements
   ============================================ */

/* ---- Scroll reveal animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(32px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-32px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(32px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ---- Selection styling ---- */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: var(--color-dark);
}

::-moz-selection {
    background: rgba(59, 130, 246, 0.2);
    color: var(--color-dark);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg, #F8FAFC);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3B82F6, #6366F1);
    border-radius: 8px;
    border: 2px solid var(--color-bg, #F8FAFC);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563EB, #4F46E5);
}

/* ---- Enhanced focus styles ---- */
*:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---- Image placeholder styling ---- */
img[src$=".svg"] {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 50%, #e2e8f0 100%);
    min-height: 200px;
}

/* ---- Text balance for headings ---- */
h1, h2, h3 {
    text-wrap: balance;
}

/* ---- Glassmorphism utility ---- */
.glass {
    background: rgba(30, 41, 59, 0.72);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* ---- Gradient text utility ---- */
.gradient-text {
    background: linear-gradient(135deg, #3B82F6, #6366F1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Card hover glow effect ---- */
.step-card,
.fondation-card,
.testimonial-card {
    position: relative;
}

.step-card::after,
.fondation-card::after,
.testimonial-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.0), rgba(99, 102, 241, 0.0));
    z-index: -1;
    transition: background 0.35s ease;
    pointer-events: none;
}

.step-card:hover::after,
.fondation-card:hover::after,
.testimonial-card:hover::after {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(99, 102, 241, 0.06));
}

/* ---- Smooth transitions for interactive elements ---- */
a, button {
    transition: all 0.25s ease;
}

/* ---- Loading state for form button ---- */
.form-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.form-submit.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ---- Print styles ---- */
@media print {
    .header,
    .cookie-banner,
    .scroll-top,
    .mobile-toggle {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    section {
        padding: 24px 0;
        page-break-inside: avoid;
    }

    .hero {
        min-height: auto;
        background: #fff;
        color: #000;
    }

    .hero h1,
    .hero .hero-subtitle {
        color: #000;
    }

    .strategie,
    .competences {
        background: #f5f5f5;
        color: #000;
    }

    .strategie .section-title,
    .competences .section-title,
    .competences .section-subtitle,
    .competence-card h3 {
        color: #000;
    }

    .materiaux-card {
        background: #f5f5f5;
        color: #000;
    }

    .materiaux-card h2,
    .materiaux-card p {
        color: #000;
    }
}

/* ---- High contrast mode ---- */
@media (forced-colors: active) {
    .btn-primary,
    .step-number,
    .timeline-dot {
        border: 2px solid currentColor;
    }
}

/* ---- Container query fallback for wide screens ---- */
@media (min-width: 1440px) {
    .container {
        max-width: 1280px;
    }
}

/* ---- Extra touch target sizing for mobile ---- */
@media (pointer: coarse) {
    .nav-list a {
        padding: 8px 4px;
    }

    .faq-list details summary {
        padding: 28px 44px 28px 0;
    }

    .footer-links a {
        padding: 6px 0;
        display: inline-block;
    }
}
