:root {
    --phi-bg: #f8fafc;
    --phi-surface: #ffffff;
    --phi-text-main: #334155;
    --phi-text-light: #64748b;
    --phi-accent: #6366f1;
    --phi-safe: #10b981; /* Émeraude doux */
    --phi-scam: #f43f5e; /* Rose doux */
    --phi-border: #e2e8f0;
}

.phi-main-wrapper {
    background: var(--phi-bg);
    border-radius: 12px;
    border: 1px solid var(--phi-border);
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--phi-text-main);
    max-width: 1000px;
    margin: 20px auto;
}

/* --- INTRO PLUS ÉLÉGANTE --- */
.phi-intro {
    padding: 60px 40px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.phi-icon-circle {
    width: 80px; height: 80px;
    background: #eef2ff;
    color: var(--phi-accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; margin: 0 auto 20px;
}

.phi-intro h3 { font-weight: 800; font-size: 1.75rem; margin-bottom: 1rem; color: #1e293b; }
.phi-intro p { color: var(--phi-text-light); line-height: 1.6; margin-bottom: 2rem; }

/* --- BOUTONS ÉPURÉS --- */
.phi-btn-main {
    background: var(--phi-accent);
    color: white; border: none;
    padding: 14px 32px; border-radius: 8px;
    font-weight: 700; cursor: pointer;
    transition: all 0.2s;
}
.phi-btn-main:hover { opacity: 0.9; transform: translateY(-1px); }

/* --- INTERFACE MAIL --- */
.phi-email-client {
    display: grid; grid-template-columns: 1fr 320px;
    background: white; border-top: 1px solid var(--phi-border);
}

.phi-email-view { padding: 40px; border-right: 1px solid var(--phi-border); }

.phi-actions {
    display: flex; gap: 20px; margin-top: 40px;
    padding: 20px; background: #f8fafc; border-radius: 12px;
}

.phi-btn-safe, .phi-btn-scam {
    flex: 1; border: none; padding: 16px; border-radius: 10px;
    font-weight: 700; cursor: pointer; transition: 0.2s;
    font-size: 0.9rem;
}

.phi-btn-safe { background: #ecfdf5; color: #065f46; border: 1px solid #d1fae5; }
.phi-btn-safe:hover { background: #d1fae5; }

.phi-btn-scam { background: #fff1f2; color: #9f1239; border: 1px solid #ffe4e6; }
.phi-btn-scam:hover { background: #ffe4e6; }

/* --- phi-top-bar : Version Épurée --- */
.phi-top-bar {
    background: #ffffff;
    padding: 1.25rem 2.5rem; /* Marges généreuses */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    /* On arrondit le haut pour qu'il s'intègre au conteneur principal */
    border-radius: 12px 12px 0 0;
}

.phi-brand {
    font-weight: 800;
    font-size: 1.05rem;
    color: #0f172a; /* Slate 900 : moins agressif que le noir */
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
}

/* Petit indicateur d'état AI */
.phi-brand span {
    color: #6366f1; /* Indigo soft */
    font-weight: 900;
}

.phi-stats {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Style des badges (Pills) */
.phi-stat {
    background: #f8fafc;
    color: #64748b;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Mise en avant spécifique du score */
#phi-score {
    color: #6366f1;
}

/* Icônes discrètes dans les stats (si ajoutées) */
.phi-stat::before {
    opacity: 0.6;
}

/* --- phi-sidebar : Version Premium & Aérée --- */
.phi-sidebar {
    background: #fcfcfd; /* Fond ultra-léger */
    border-left: 1px solid #f1f5f9;
    padding: 2rem 1.5rem; /* Marges internes confortables */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Titre de la section indices */
.phi-sidebar-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #94a3b8; /* Slate 400 */
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.phi-sidebar-label::before {
    content: "";
    width: 4px;
    height: 4px;
    background: #6366f1;
    border-radius: 50%;
}

/* --- CARTES D'INDICES (Hint Cards) --- */
.phi-hint-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    padding: 1.25rem;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: transform 0.2s ease;
}

.phi-hint-card:hover {
    transform: translateX(-4px);
    border-color: #e2e8f0;
}

.phi-hint-card strong {
    display: block;
    color: #1e293b;
    margin-bottom: 4px;
    font-weight: 700;
}

.phi-hint-card span {
    color: #64748b;
    line-height: 1.5;
    display: block;
}

/* Animation d'entrée douce */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- Barre d'état (URL Preview) --- */
.phi-status-bar {
    position: absolute;
    bottom: 90px; /* Juste au-dessus des boutons d'action */
    left: 40px;
    background: rgba(15, 23, 42, 0.9); /* Ardoise foncé transparent */
    color: #f1f5f9;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none; /* Ne bloque pas les clics */
    z-index: 10;
}

.phi-status-bar.visible {
    opacity: 1;
}

/* On s'assure que la vue email est en position relative pour placer la barre */
.phi-email-view {
    position: relative;
    padding-bottom: 140px; /* Espace pour la barre et les actions */
}

/* Style spécifique pour les liens suspects */
.phi-flag[data-url] {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 3px;
}