/* ==========================================================================
   1. VARIABLES & CONFIGURATION DU THEME (identique à ac-nova.fr)
   ========================================================================== */
:root {
    --bg-dark: #070913;
    --bg-card: #0e1326;
    --bg-card-hover: #141b34;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.35);
    --accent: #10b981;
    --warn: #f59e0b;
    --down: #ef4444;
    --mnt: #8b5cf6;
    --border-color: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(37, 99, 235, 0.3);

    --nav-bg: #ebf1fa;
    --nav-text: #475569;
    --nav-text-hover: #2563eb;
    --nav-border: rgba(0, 0, 0, 0.05);

    --card-light-bg: #ffffff;
    --card-light-border: rgba(0, 0, 0, 0.06);
    --card-light-text: #1e293b;
    --card-light-muted: #64748b;

    --transition-fast: 0.2s ease;
    --transition-med: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.theme-light {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f4f7fc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(37, 99, 235, 0.35);
}

body.theme-light .page-hero h1 span {
    background: linear-gradient(to right, #0f172a, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.theme-light .footer { background: #f1f5f9; }
body.theme-light .footer-bottom { color: rgba(15, 23, 42, 0.35); }

/* ==========================================================================
   2. BASES & RESET
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    padding-top: 75px;
    transition: background-color var(--transition-med), color var(--transition-med);
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
a { color: inherit; }

/* ==========================================================================
   3. NAVBAR
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 2000;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.7rem 2rem;
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.3rem;
    color: #1e293b;
    text-decoration: none;
    letter-spacing: 0.5px;
}
.logo span { color: var(--primary); }

.nav-links { display: flex; list-style: none; align-items: center; gap: 1.8rem; }
.nav-item {
    position: relative;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    padding: 0.3rem 0;
}
.nav-item::after {
    content: "";
    position: absolute;
    left: 0; bottom: -2px;
    width: 0; height: 2px;
    background: var(--primary);
    transition: width var(--transition-fast);
}
.nav-item:hover { color: var(--nav-text-hover); }
.nav-item:hover::after, .nav-item.active::after { width: 100%; }
.nav-item.active { color: var(--nav-text-hover); }

.nav-right { display: flex; align-items: center; gap: 1.3rem; }
.theme-toggle {
    color: var(--nav-text);
    font-size: 1.1rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast), transform var(--transition-fast);
    display: flex;
    align-items: center;
}
.theme-toggle:hover { color: var(--primary); transform: translateY(-2px); }

.btn-client {
    background: var(--primary);
    color: #fff !important;
    padding: 0.55rem 1.3rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    transition: background var(--transition-fast), transform var(--transition-fast);
}
.btn-client:hover { background: #1d4ed8; transform: translateY(-2px); }

/* ==========================================================================
   4. PAGE HERO
   ========================================================================== */
.page-hero {
    position: relative;
    padding: 4.5rem 1rem 3rem 1rem;
    text-align: center;
    overflow: hidden;
}
.hero-glow {
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(0,0,0,0) 70%);
    z-index: 0;
    pointer-events: none;
    animation: glow-pulse 6s ease-in-out infinite;
}
@keyframes glow-pulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(1.15); opacity: 0.75; }
}
.page-hero > * { position: relative; z-index: 1; }

.badge-promo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: #93c5fd;
    padding: 0.45rem 1.1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.75rem;
}
.badge-promo .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.badge-promo.ok .dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.badge-promo.warn .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.badge-promo.down .dot { background: var(--down); box-shadow: 0 0 0 3px rgba(239,68,68,0.2); animation: pulse-dot 1.4s ease-in-out infinite; }
.badge-promo.mnt .dot { background: var(--mnt); box-shadow: 0 0 0 3px rgba(139,92,246,0.2); }
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
    50% { box-shadow: 0 0 0 6px rgba(239,68,68,0.08); }
}

.page-hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 1rem;
}
.page-hero h1 span {
    background: linear-gradient(to right, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.page-hero p {
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.6;
}

.clock-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    margin-top: 1.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.clock-row .clock {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}
.clock-row .cursor {
    display: inline-block;
    width: 8px;
    margin-left: 2px;
    border-bottom: 2px solid var(--accent);
    animation: blink 1s step-start infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ==========================================================================
   5. STATS (résumé global)
   ========================================================================== */
.stats-section { padding: 1.5rem 0 4rem 0; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    text-align: center;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.stat-card:hover { transform: translateY(-6px); border-color: var(--border-hover); }
.stat-card h2 { font-size: 2.2rem; font-weight: 800; margin-bottom: 0.35rem; color: var(--primary); }
.stat-card h2.c-ok { color: var(--accent); }
.stat-card h2.c-warn { color: var(--warn); }
.stat-card h2.c-down { color: var(--down); }
.stat-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ==========================================================================
   6. SERVICES (cartes façon feature-card)
   ========================================================================== */
.services-section { padding: 0 0 6rem 0; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header .sub-title {
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 0.5rem;
}
.section-header h2 { font-size: 2rem; font-weight: 700; margin-bottom: 0.6rem; }
.section-header p { color: var(--text-muted); font-size: 1rem; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.75rem; }

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.9rem 2rem 1.7rem;
    border-radius: 16px;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.feature-card:hover { border-color: var(--border-hover); transform: translateY(-6px); }

.card-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
}
.service-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    overflow: hidden;
    transition: transform var(--transition-fast);
}
.service-logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.feature-card:hover .service-logo { transform: scale(1.08) rotate(-4deg); }

.card-title { flex: 1; min-width: 0; }
.card-title h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.card-title h3 a { text-decoration: none; color: inherit; }
.card-title h3 a:hover { color: var(--primary); }
.card-title h3 i { font-size: 0.7em; opacity: 0.45; margin-left: 4px; }

/* Voyant de statut (vert / rouge / orange) */
.voyant-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.voyant {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.25);
}
.voyant.ok { background: var(--accent); box-shadow: 0 0 0 4px rgba(16,185,129,0.18), 0 0 10px rgba(16,185,129,0.6); }
.voyant.down { background: var(--down); box-shadow: 0 0 0 4px rgba(239,68,68,0.18), 0 0 10px rgba(239,68,68,0.6); animation: pulse-dot 1.3s ease-in-out infinite; }
.voyant.warn { background: var(--warn); box-shadow: 0 0 0 4px rgba(245,158,11,0.18), 0 0 10px rgba(245,158,11,0.6); }
.voyant-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
}

.feature-card p.desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; margin-bottom: 1.3rem; }

.history { display: flex; gap: 2px; margin-bottom: 1.1rem; }
.history .tick { flex: 1; height: 18px; border-radius: 3px; background: rgba(255,255,255,0.06); }
.history .tick.ok { background: var(--accent); opacity: 0.55; }
.history .tick.warn { background: var(--warn); opacity: 0.7; }
.history .tick.down { background: var(--down); opacity: 0.85; }

.feature-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 0.9rem;
}
.feature-meta strong { color: var(--text-main); font-weight: 600; }

/* ==========================================================================
   7. BANNIÈRE D'ERREUR
   ========================================================================== */
.error-banner {
    display: none;
    margin: 0 0 2rem 0;
    padding: 1rem 1.4rem;
    border: 1px solid rgba(239,68,68,0.25);
    background: rgba(239,68,68,0.08);
    color: #fca5a5;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.5;
}
.error-banner.show { display: block; }

/* ==========================================================================
   8. ANIMATIONS AU CHARGEMENT
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    .reveal, .hero-glow { transition: none !important; animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
.footer {
    background: #04060d;
    border-top: 1px solid var(--border-color);
    padding: 4rem 2rem 2rem 2rem;
    transition: background-color var(--transition-med);
    margin-top: 2rem;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}
.footer-block h3 span { color: var(--primary); }
.footer-block p { color: var(--text-muted); margin-top: 1rem; font-size: 0.9rem; line-height: 1.5; }
.footer-block h4 { font-size: 1rem; color: var(--text-main); margin-bottom: 1.1rem; }
.footer-block a { display: block; color: var(--text-muted); text-decoration: none; margin-bottom: 0.6rem; font-size: 0.9rem; transition: color var(--transition-fast), transform var(--transition-fast); }
.footer-block a:hover { color: var(--text-main); transform: translateX(4px); }
.footer-block code {
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.footer-bottom {
    max-width: 1200px;
    margin: 3rem auto 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
}

/* ==========================================================================
   10. RESPONSIVE
   ========================================================================== */
@media (max-width: 992px) {
    .footer-container { grid-template-columns: 1fr; gap: 2rem; }
    .page-hero h1 { font-size: 2.2rem; }
}
@media (max-width: 560px) {
    .nav-container { padding: 0.7rem 1.2rem; }
    .page-hero h1 { font-size: 1.9rem; }
    .clock-row { gap: 0.7rem; }
}
