/* ============================================================================
   ISC-Concept — Design system glassmorphism sombre
   ============================================================================ */

/* ---------- 1. Variables racines ---------- */
:root {
    --surface-900: #0a0a0f;
    --surface-800: #14141c;
    --surface-700: #1a1a24;
    --text-primary:   #f5f5f7;
    --text-secondary: #a1a1aa;
    --glass-bg:     rgba(255, 255, 255, 0.05);
    --glass-bg-strong: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-border-strong: rgba(255, 255, 255, 0.18);
    --accent-orange: #f97316;
    --accent-yellow: #fbbf24;
    --accent-red:    #dc2626;
    --easing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Alpine cloak */
[x-cloak] { display: none !important; }

/* Scroll fluide global */
html { scroll-behavior: smooth; }

/* Compensation header sticky pour ancres */
:target,
[id]:not(body) { scroll-margin-top: 6rem; }

/* Sélection harmonisée */
::selection { background-color: rgba(249, 115, 22, 0.35); color: #fff; }

/* Focus visible accessible */
*:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 3px;
    border-radius: 6px;
}

/* Scrollbars discrètes */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--surface-900); }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Masquer scrollbar horizontale (sommaire services) */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ---------- 2. Bulles d'arrière-plan animées ---------- */
.bg-bubbles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}
.bubble {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    will-change: transform;
}
.bubble-orange {
    width: 500px; height: 500px;
    top: -100px; left: -150px;
    background: var(--accent-orange);
    opacity: 0.40;
    animation: float-1 18s ease-in-out infinite;
}
.bubble-red {
    width: 600px; height: 600px;
    bottom: -200px; right: -200px;
    background: var(--accent-red);
    opacity: 0.30;
    animation: float-2 22s ease-in-out infinite;
}
.bubble-yellow {
    width: 400px; height: 400px;
    top: 40%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent-yellow);
    opacity: 0.20;
    animation: float-3 25s ease-in-out infinite;
}
@keyframes float-1 {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(40px, 60px, 0); }
}
@keyframes float-2 {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(-50px, -40px, 0); }
}
@keyframes float-3 {
    0%, 100% { transform: translate(-50%, -50%) translate3d(0, 0, 0); }
    50%      { transform: translate(-50%, -50%) translate3d(30px, -50px, 0); }
}

/* ---------- 3. Glassmorphism ---------- */
.glass-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
            backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}
.glass-strong {
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
            backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid var(--glass-border-strong);
    border-radius: 24px;
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}
.glass-nav {
    background: rgba(10, 10, 15, 0.65);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
            backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
}
/* Fallback navigateurs sans backdrop-filter */
@supports not ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
    .glass-card,
    .glass-strong,
    .glass-nav {
        background: rgba(20, 20, 28, 0.92);
    }
}

/* ---------- 4. Boutons ---------- */
.btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-yellow) 100%);
    background-size: 200% 200%;
    background-position: 0% 50%;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.35);
    transition: all 0.4s var(--easing);
    overflow: hidden;
}
.btn-primary:hover {
    background-position: 100% 50%;
    transform: translateY(-2px);
    box-shadow: 0 8px 35px rgba(249, 115, 22, 0.55);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary-pulse { animation: btn-pulse 3s ease-in-out infinite; }
@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(249, 115, 22, 0.35); }
    50%      { box-shadow: 0 4px 30px rgba(249, 115, 22, 0.6); }
}

.btn-glass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(20px);
            backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border-strong);
    border-radius: 12px;
    transition: all 0.3s var(--easing);
}
.btn-glass:hover {
    background: var(--glass-bg-strong);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* ---------- 5. Animations entrée au scroll ---------- */
.reveal-on-scroll {
    opacity: 0;
    transition: opacity 0.8s var(--easing), transform 0.8s var(--easing);
    will-change: opacity, transform;
}
.reveal-on-scroll.fade-in-up   { transform: translateY(30px); }
.reveal-on-scroll.fade-in-left { transform: translateX(-30px); }
.reveal-on-scroll.fade-in-right{ transform: translateX(30px); }
.reveal-on-scroll.fade-in      { transform: none; transition-duration: 0.6s; }
.reveal-on-scroll.visible {
    opacity: 1;
    transform: none;
}

/* ---------- 6. Hover des cartes ---------- */
.card-hover {
    transition: transform 0.4s var(--easing),
                border-color 0.4s var(--easing),
                background 0.4s var(--easing);
}
.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(249, 115, 22, 0.4);
    background: rgba(255, 255, 255, 0.07);
}

/* ---------- 7. Hero — animation séquentielle des mots ---------- */
.hero-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: word-in 0.8s var(--easing) forwards;
}
@keyframes word-in {
    to { opacity: 1; transform: translateY(0); }
}
.hero-fade {
    opacity: 0;
    animation: fade-in 0.8s var(--easing) forwards;
}
@keyframes fade-in {
    to { opacity: 1; }
}

/* ---------- 8. Navigation — soulignement actif ---------- */
.nav-link {
    position: relative;
    transition: color 0.25s var(--easing);
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-yellow));
    border-radius: 2px;
    transition: all 0.3s var(--easing);
    transform: translateX(-50%);
}
.nav-link:hover::after,
.nav-link.is-active::after {
    width: 70%;
}

/* ---------- 9. WhatsApp flottant ---------- */
.whatsapp-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.45);
    transition: transform 0.3s var(--easing), box-shadow 0.3s var(--easing);
}
.whatsapp-fab:hover {
    transform: scale(1.15);
    box-shadow: 0 10px 35px rgba(37, 211, 102, 0.7);
}
.whatsapp-fab::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #25D366;
    opacity: 0.7;
    animation: whatsapp-ping 2s ease-out infinite;
    z-index: -1;
}
@keyframes whatsapp-ping {
    0%   { transform: scale(1); opacity: 0.7; }
    80%, 100% { transform: scale(1.6); opacity: 0; }
}
@media (min-width: 1024px) {
    .whatsapp-fab { width: 4rem; height: 4rem; }
}

/* ---------- 10. Inputs en glassmorphism ---------- */
.glass-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    width: 100%;
    transition: all 0.25s var(--easing);
}
.glass-input::placeholder { color: rgba(161, 161, 170, 0.6); }
.glass-input:hover { border-color: rgba(255, 255, 255, 0.20); }
.glass-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.20);
    outline: none;
}
.glass-input.has-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
/* Select : adapter la flèche au thème sombre */
select.glass-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}
select.glass-input option { background: var(--surface-800); color: var(--text-primary); }
/* Input file dark */
.glass-input[type="file"]::-webkit-file-upload-button {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    margin-right: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}
.glass-input[type="file"]::-webkit-file-upload-button:hover {
    background: rgba(249, 115, 22, 0.3);
}

/* ---------- 11. Lien d'évitement (a11y) ---------- */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.focus\:not-sr-only:focus {
    position: fixed; width: auto; height: auto; padding: inherit;
    margin: 0; overflow: visible; clip: auto; white-space: normal;
}

/* ---------- 12. Iframe carte (intégration sombre) ---------- */
.map-frame {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ---------- 13. Impression ---------- */
@media print {
    .bg-bubbles, header, footer, .whatsapp-fab { display: none !important; }
    body { background: white; color: black; }
    .glass-card, .glass-strong { background: white; border: 1px solid #ccc; }
}

/* ---------- 14. prefers-reduced-motion : kill-switch ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal-on-scroll { opacity: 1 !important; transform: none !important; }
    .bubble { animation: none !important; }
    .whatsapp-fab::before { display: none !important; }
}
