/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    /* Couleurs */
    --bg-deep: #050505;
    --card-bg: rgba(20, 20, 20, 0.7); /* Plus transparent pour l'effet verre */
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.2);
    
    --text-main: #ffffff;
    --text-muted: #9ca3af; /* Gris plus doux */
    
    --accent: #00ffa3;
    --accent-glow: rgba(0, 255, 163, 0.15);
    --danger: #ff4d4d;
    --warning: #ffb700;
    --tv-blue: #2962FF;

    /* Typos */
    --font-tech: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Dimensions Clés */
    --max-card-width: 520px; /* Élargi pour de meilleures proportions */
    --side-btn-width: 460px;
    --border-radius: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* =========================================
   2. BODY & AMBIANCE
   ========================================= */
body {
    background-color: var(--bg-deep);
    /* Fond plus riche et profond */
    background-image: 
        radial-gradient(circle at 50% 0%, #1a202c 0%, transparent 60%),
        radial-gradient(circle at 50% 100%, #0f1216 0%, var(--bg-deep) 100%);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow-x: hidden;
    /* Zoom léger pour affiner l'interface sur desktop */
    -webkit-font-smoothing: antialiased;
}

/* Zoom spécifique Desktop */
@media (min-width: 1200px) { body { zoom: 0.75; } }

.brand {
    text-align: center; font-family: var(--font-tech); letter-spacing: 8px;
    font-size: 0.75rem; color: var(--text-muted); opacity: 0.6;
    margin-bottom: 40px; width: 100%; z-index: 10; font-weight: 600;
}

/* =========================================
   3. LAYOUT PRINCIPAL (LA GRILLE)
   ========================================= */
.main-wrapper {
    position: relative;
    width: 100%;
    max-width: 1400px;
    display: flex; /* Mobile first: colonne */
    flex-direction: column;
    align-items: center;
    z-index: 5;
}
/* --- NOUVEAU STYLE POUR LA CARTE MOAT & 4M --- */

/* Conteneur pour le graphique pour assurer le centrage */
.moat-chart-container {
    position: relative;
    height: 140px; /* Un peu plus grand pour l'impact */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

/* Grille pour les scores Management / Macro sous le graph */
.four-m-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Deux colonnes égales */
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Ligne de séparation subtile */
}

/* Style des "pilules" de score individuelles */
.m-score-card {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s ease;
}

.m-score-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Style de l'icône à gauche du score */
.m-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Conteneur texte et valeur */
.m-info {
    display: flex;
    flex-direction: column;
}

.m-label {
    font-size: 0.7rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
    margin-bottom: 2px;
}

.m-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    /* La couleur sera définie dynamiquement par le JS */
}




/* =========================================
   4. CARTE CENTRALE (SIGNAL CARD)
   ========================================= */
.signal-card {
    width: 100%; 
    max-width: var(--max-card-width);
    position: relative;
    z-index: 10;
    
    /* Design Glassmorphism Premium */
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 35px 40px;
    
    /* Ombre portée douce mais présente */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    
    text-align: center;
    overflow: hidden;
    margin-bottom: 30px;
    
    /* Animation d'apparition */
    animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* La ligne néon en haut */
.signal-card::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 120px; height: 1px; background: var(--accent);
    box-shadow: 0 0 25px var(--accent); z-index: 5;
}

/* Logo de fond subtil */
.logo-bg-img {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 60%; height: 60%; object-fit: contain; opacity: 0.08; filter: grayscale(100%);
    z-index: 0; pointer-events: none;
}

.card-content { position: relative; z-index: 2; }

/* --- TYPOGRAPHIE & HEADER --- */
.date-badge {
    font-family: var(--font-tech); font-size: 0.6rem; color: var(--accent);
    border: 1px solid rgba(0, 255, 163, 0.3); background: rgba(0, 255, 163, 0.05);
    padding: 5px 12px; border-radius: 100px; display: inline-block; 
    margin-bottom: 20px; font-weight: 600; letter-spacing: 1px;
}

.company-name {
    font-family: var(--font-tech); font-size: 2.5rem; font-weight: 700;
    line-height: 1; margin-bottom: 5px; color: white;
    letter-spacing: -1px; text-transform: uppercase;
}

.ticker { display: block; margin-bottom: 25px; }
.ticker a {
    color: var(--text-muted); text-decoration: none;
    font-family: var(--font-tech); letter-spacing: 2px; font-size: 1.1rem;
    border-bottom: 1px dotted transparent; transition: all 0.3s;
}
.ticker a:hover { color: var(--accent); border-color: var(--accent); }

/* --- PROFIL ENTREPRISE (MODERNE) --- */
/* --- PROFIL ENTREPRISE (DESIGN MINIMALISTE / SANS CADRE) --- */
.company-profile {
    width: 100%;
    /* On retire tout l'aspect "Boite/Pancarte" */
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    
    padding: 0; /* Plus de padding interne */
    margin-bottom: 25px;
    margin-top: 10px;
    text-align: center;
}

/* On enlève la barre latérale verte car il n'y a plus de cadre */
.company-profile::after { display: none; }

.profile-header {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.profile-tag {
    font-family: var(--font-tech);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--accent);
    /* On garde un fond très léger pour les tags pour qu'ils ressortent */
    background: rgba(0, 255, 163, 0.08); 
    border: 1px solid rgba(0, 255, 163, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
}

.profile-desc {
    font-size: 0.9rem;
    color: #ccc; /* Gris clair pour être lisible sur le fond noir */
    line-height: 1.5;
    font-family: var(--font-body);
    font-weight: 300;
    margin: 0;
    /* On limite la largeur pour que les lignes ne soient pas trop longues à lire */
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}
/* --- GRILLE MÉTRIQUES (Propre & Aérée) --- */
.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonnes équilibrées */
    gap: 20px; /* Espace aéré */
    margin: 30px 0;
    padding: 25px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.metric-item { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.metric-label {
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 1px;
    color: #666; margin-bottom: 6px; font-family: var(--font-tech); font-weight: 600;
}
.metric-value {
    font-family: var(--font-tech); font-size: 1.3rem; font-weight: 600; color: #eee;
}
.highlight { color: #fff; font-size: 1.4rem; font-weight: 700; }
.accent { color: var(--accent); text-shadow: 0 0 15px var(--accent-glow); }

/* --- JUSTIFICATION & FOOTER --- */
.justification {
    font-size: 0.95rem; line-height: 1.6; color: #bbb;
    font-style: italic; font-family: 'Georgia', serif; margin-bottom: 20px;
    padding: 0 10px; opacity: 0.9;
}
.details-cta {
    color: #ffff; /* <--- C'EST ICI QUE TU CHANGES LA COULEUR */
    
    /* Autres styles pour que ce soit joli */
    text-decoration: none;      /* Enlève le soulignement par défaut */
    font-weight: 600;           /* Un peu plus gras */
    font-size: 0.9rem;          /* Taille du texte */
    margin-top: 15px;           /* Espace au dessus */
    display: inline-block;      /* Permet de bien gérer les marges */
    transition: all 0.3s ease;  /* Transition douce */
    border-bottom: 1px solid transparent; /* Prépare le soulignement */
}

/* Effet quand on passe la souris dessus */
.details-cta:hover {
    color: #00ffa3;             /* Devient blanc au survol */
    border-bottom: 1px solid #00ffa3; /* Soulignement vert au survol */
    transform: translateY(-2px); /* Petite animation vers le haut */
}

/* Stats rapides (Feux verts) */
.data-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 15px; margin-bottom: 20px; opacity: 0.8; }
.stat-item { font-size: 0.65rem; font-family: var(--font-tech); color: var(--text-muted); }
.sector-tag { font-size: 0.6rem; color: #555; text-transform: uppercase; letter-spacing: 4px; display: block; font-family: var(--font-tech); margin-top: 10px;}

/* =========================================
   5. BOUTONS & CTA
   ========================================= */
/* --- BOUTONS LATÉRAUX CORRIGÉS --- */
.side-buttons-container {
    width: 100%; max-width: var(--max-card-width);
    display: flex; flex-direction: column; gap: 15px;
    margin-bottom: 25px; z-index: 10; pointer-events: auto;
}

.side-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 16px 20px; /* Padding augmenté pour aérer */
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid var(--border); border-radius: 16px;
    text-decoration: none; color: var(--text-main);
    backdrop-filter: blur(10px); transition: all 0.3s ease;
    text-align: center;
}

.side-btn-text {
    display: flex;
    flex-direction: column; /* Force l'empilement vertical */
    align-items: center;
    line-height: 1.4;
}

/* Nouveau style pour le titre du bouton */
.btn-title {
    font-family: var(--font-tech);
    font-size: 0.75rem; /* Taille lisible */
    font-weight: 700;   /* Gras */
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    display: block;     /* Force le bloc */
    margin-bottom: 4px; /* Espace avec le sous-texte */
}

/* Correction du sous-texte */
.side-btn-subtext { 
    font-size: 0.55rem; 
    color: var(--text-muted); 
    opacity: 0.8; 
    text-transform: none; 
    font-weight: 400;
    display: block; /* CRUCIAL : Force le retour à la ligne */
    max-width: 90%; /* Évite que le texte touche les bords */
}
.cta-btn svg { width: 20px; height: 20px; ... }
.tv-btn-side:hover { background: rgba(41, 98, 255, 0.15); border-color: var(--tv-blue); transform: translateY(-2px); }
.tv-btn-side:hover .btn-title { color: var(--tv-blue); } /* Le titre change de couleur au survol */

.portfolio-btn-side:hover { background: rgba(0, 255, 163, 0.15); border-color: var(--accent); transform: translateY(-2px); }
.portfolio-btn-side:hover .btn-title { color: var(--accent); }

.side-btn-icon svg { width: 22px; height: 22px; stroke-width: 2; margin-bottom: 2px; }

/* --- 5. BOUTON CTA PRINCIPAL (S'ABONNER) --- */
.cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px; /* Espace entre icône et texte */
    width: 100%;
    max-width: var(--max-card-width);
    padding: 18px;
    background: var(--accent);
    color: #000; /* Texte noir sur fond vert */
    border: none;
    border-radius: 16px;
    font-family: var(--font-tech);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px var(--accent-glow);
    z-index: 10;
    margin-top: 25px; /* Espace avec la carte */
}

.cta-btn:hover {
    background: #00e692;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 255, 163, 0.4);
}

/* C'EST ICI QUE ÇA SE JOUE : On bride la taille du SVG */
.cta-btn svg {
    width: 20px;  /* Largeur fixe */
    height: 20px; /* Hauteur fixe */
    fill: currentColor; /* Prend la couleur du texte (noir) */
    flex-shrink: 0; /* Empêche l'écrasement */
}
/* =========================================
   6. SECTION ANALYSE (GRAPHIQUES)
   ========================================= */
.analysis-container {
    width: 100%; max-width: var(--max-card-width); /* Alignement avec la carte */
    margin-top: 40px; padding-top: 30px;
    border-top: 1px solid var(--border);
}
.analysis-title {
    font-family: var(--font-tech); color: var(--accent);
    text-transform: uppercase; letter-spacing: 3px; font-size: 0.9rem;
    text-align: center; margin-bottom: 25px; opacity: 0.8;
}
.analysis-card {
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid var(--border); border-radius: 16px;
    padding: 25px; margin-bottom: 20px;
}
.analysis-card h4 {
    font-family: var(--font-tech); font-size: 1rem; font-weight: 500;
    margin-bottom: 20px; color: #fff;
    border-bottom: 1px solid var(--border); padding-bottom: 10px;
}

/* Grille Scores Qualité */
.score-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.simple-score-item { padding: 0; }
.score-visualization {
    padding: 12px; border: 1px solid var(--border); border-radius: 8px;
    background: rgba(255,255,255,0.02); transition: border-color 0.3s;
}
.score-label { font-size: 0.65rem; text-transform: uppercase; color: #888; font-family: var(--font-tech); margin-bottom: 5px; display: block; }
.score-value { font-family: var(--font-tech); font-size: 1.2rem; font-weight: 700; display: block; margin-bottom: 5px; }
.status-bar { width: 100%; height: 4px; border-radius: 2px; opacity: 0.7; }

/* Graphiques */
/* DANS style.css */

#moat-chart {
    height: 120px; 
    width: 100%;
    /* CRUCIAL : Définit le référentiel pour le texte en absolute */
    position: relative; 
    /* Centre le contenu (le canvas) */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* On s'assure que le canvas ne dépasse pas */
#moatRing {
    max-height: 100%;
    max-width: 100%;
    z-index: 1; /* Le graphique en dessous */
}

/* =========================================
   7. MODALE & UI ELEMENTS
   ========================================= */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 100; display: none; justify-content: center; align-items: center; padding: 20px; backdrop-filter: blur(8px); }
.modal-overlay.active { display: flex; animation: fadeUp 0.3s ease; }
.modal-box { background: #0a0a0a; border: 1px solid var(--accent); padding: 40px 30px; border-radius: 24px; width: 100%; max-width: 400px; box-shadow: 0 0 50px rgba(0, 255, 163, 0.15); }
.close-btn { position: absolute; top: 20px; right: 20px; background: none; border: none; color: #555; font-size: 1.5rem; cursor: pointer; }
.close-btn:hover { color: #fff; }
.inp { width: 100%; padding: 14px; background: #111; border: 1px solid #333; color: white; border-radius: 10px; font-family: var(--font-body); font-size: 0.9rem; outline: none; transition: 0.3s; }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 10px rgba(0,255,163,0.1); }
.label-sm { font-size: 0.7rem; color: #777; margin-bottom: 6px; display: block; font-family: var(--font-tech); letter-spacing: 1px; }
.nom-prenom-row { display: flex; gap: 15px; margin-bottom: 15px; }
.form-group { margin-bottom: 20px; }
.checkbox-row { display: flex; justify-content: space-between; margin: 25px 0; background: #111; padding: 15px; border-radius: 10px; border: 1px solid #222; }
.cb-item { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: #bbb; cursor: pointer; font-family: var(--font-tech); } 
.cb-item input { accent-color: var(--accent); }
.consent-row { margin-bottom: 25px; } .consent-label { font-size: 0.75rem; color: #666; display: flex; gap: 10px; line-height: 1.4; }
.consent-label a { color: var(--accent); }
.submit-btn { width: 100%; padding: 16px; background: var(--accent); border: none; font-weight: bold; cursor: pointer; border-radius: 10px; font-family: var(--font-tech); letter-spacing: 1px; font-size: 0.9rem; transition: 0.3s; }
.submit-btn:hover { background: #00e692; transform: translateY(-2px); }
#form-status { text-align: center; margin-top: 15px; font-family: var(--font-tech); font-size: 0.8rem; }

/* Loader & Error */
#loader { font-family: var(--font-tech); color: #666; font-size: 0.8rem; letter-spacing: 4px; animation: pulse 1.5s infinite; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); }
#error-box { color: var(--danger); font-family: var(--font-tech); border: 1px solid var(--danger); padding: 20px; border-radius: 12px; background: rgba(255, 77, 77, 0.05); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* =========================================
   9. RESPONSIVE (LE COEUR DU PROBLÈME)
   ========================================= */

/* --- DESKTOP (> 1200px) : Disposition Latérale Parfaite --- */
@media (min-width: 1200px) {
    .main-wrapper {
        display: grid;
        /* Colonnes : Espace | Carte (580px) | Espace */
        grid-template-columns: 1fr var(--max-card-width) 1fr;
        grid-template-rows: auto auto auto; /* Carte | CTA | Analyse */
        align-items: center; /* Centrage vertical des boutons */
        width: 100%;
        max-width: 100%; /* Prend toute la largeur */
        padding: 0 40px; /* Marges de sécurité */
    }

    /* Rend le conteneur transparent pour la grille */
    .side-buttons-container { display: contents; }

    /* Bouton Gauche (TradingView) - Centré dans l'espace gauche */
    .tv-btn-side {
        grid-column: 1 / 2;
        grid-row: 1;
        justify-self: center;
        width: var(--side-btn-width);
        margin: 0;
        opacity: 1;
        transform: none;
    }

    /* Carte Centrale */
    .signal-card {
        grid-column: 2 / 3;
        grid-row: 1;
        margin-bottom: 0;
        width: 100%;
    }

    /* Bouton Droit (Portefeuille) - Centré dans l'espace droit */
    .portfolio-btn-side {
        grid-column: 3 / 4;
        grid-row: 1;
        justify-self: center;
        width: var(--side-btn-width);
        margin: 0;
        opacity: 1;
        transform: none;
    }

    /* CTA (S'abonner) - Sous la carte */
    .cta-btn {
        grid-column: 2 / 3;
        grid-row: 2;
        width: 100%;
        margin-top: 25px;
        opacity: 1;
        transform: none;
        animation: none;
    }

    /* Analyse - Tout en bas */
    .analysis-container {
        grid-column: 2 / 3;
        grid-row: 3;
        width: 100%;
        margin-top: 40px;
    }
}

/* --- TABLETTE (< 1200px) --- */
@media (max-width: 1200px) {
    .main-wrapper { display: flex; flex-direction: column; }
    
    .side-buttons-container {
        flex-direction: row; /* Côte à côte au-dessus de la carte */
        width: 100%;
        max-width: var(--max-card-width);
        gap: 15px;
        pointer-events: auto;
    }
    .side-btn { width: 50%; min-width: 0; }
    
    /* On resserre un peu les métriques */
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .score-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- MOBILE (< 600px) --- */
@media (max-width: 600px) {
    .side-buttons-container { flex-direction: column; }
    .side-btn { width: 100%; }
    .metrics { gap: 15px 10px; }
    .score-grid { grid-template-columns: 1fr; }
    
    .company-name { font-size: 2rem; }
    .signal-card { padding: 25px 20px; }
}

/* --- FOOTER (PIED DE PAGE) --- */
.site-footer {
    width: 100%;
    max-width: 100%;
    padding: 40px 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border);
    text-align: center;
    position: relative;
    z-index: 5;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    font-family: var(--font-tech);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.footer-sep {
    color: #333;
    margin: 0 10px;
}

.copyright {
    font-family: var(--font-body);
    font-size: 0.65rem;
    color: #444;
}