/*
 * Analyseur d'en-têtes HTTP : styles dédiés, scopés sous .ahe.
 * Aligné sur le patron des autres outils (cf. extracteur-entites.css).
 */

.ahe .ahe-section-titre {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    margin: 0 0 1rem;
    border-bottom: 2.5px solid var(--brand-gold);
}
.ahe .ahe-section-titre > .bi:first-child { color: var(--brand-teal); }

/* Ligne de recherche : champ + bouton à droite. */
.ahe .ahe-recherche { display: flex; gap: 0.5rem; align-items: flex-end; flex-wrap: wrap; }
.ahe .ahe-champ { flex: 1 1 320px; min-width: 0; }
.ahe .ahe-btn-extraire { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 640px) {
    .ahe .ahe-btn-extraire { flex-basis: 100%; justify-content: center; }
}

/* Carte d'intro « Comment ca marche » en deux colonnes. */
.ahe .ahe-intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 2rem; }
.ahe .ahe-intro-grid ul { padding-left: 1.2rem; margin: 0; font-size: 0.88rem; line-height: 1.6; color: var(--text-secondary); }
.ahe .ahe-intro-titre { font-weight: 700; color: var(--brand-dark); margin-bottom: 0.5rem; }

/* Formulaire soigne. */
.ahe .form-control {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    padding: 0.55rem 0.8rem;
}
.ahe .form-control:focus {
    outline: none;
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 0.2rem rgba(102, 178, 178, 0.25);
}
.ahe .ahe-input-group { display: flex; align-items: stretch; }
.ahe .ahe-input-group .ahe-input-icone {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.85rem;
    background: var(--brand-teal-light);
    color: var(--brand-dark);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 1.15rem;
}
.ahe .ahe-input-group .form-control { flex: 1 1 auto; min-width: 0; border-radius: 0 6px 6px 0; }

/* Message de statut. */
.ahe .status-msg { padding: 0.7rem 1rem; border-radius: 8px; font-size: 0.92rem; font-weight: 500; }
.ahe .status-info { background: var(--brand-teal-light); color: var(--brand-dark); }
.ahe .status-error { background: #fde8e8; color: #b42318; }

/* KPIs. */
.ahe .kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.ahe .kpi-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.1rem 1.25rem;
    box-shadow: rgba(0, 76, 76, 0.06) 0 2px 8px, rgba(0, 0, 0, 0.04) 0 1px 3px;
}
.ahe .kpi-value { font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--brand-dark); }
.ahe .kpi-value small { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.ahe .kpi-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.3rem; }
.ahe .kpi-dark .kpi-value { color: var(--brand-dark); }
.ahe .kpi-gold .kpi-value { color: #c8860a; }
.ahe .kpi-green .kpi-value { color: #198754; }
.ahe .kpi-red .kpi-value { color: #dc3545; }

/* Pastilles de severite. */
.ahe .ahe-pastille {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    flex: 0 0 auto;
    vertical-align: middle;
}
.ahe .ahe-pastille.sev-ok { background: #198754; }
.ahe .ahe-pastille.sev-info { background: var(--brand-teal); }
.ahe .ahe-pastille.sev-warn { background: var(--brand-gold); }
.ahe .ahe-pastille.sev-bad { background: #dc3545; }
/* Variante pastille-badge (chaine : code HTTP a l'interieur). */
.ahe .ahe-hop .ahe-pastille, .ahe .ahe-ttfb-meta .ahe-pastille {
    width: auto;
    height: auto;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
}

/* Chaine de redirections. */
.ahe .ahe-chaine { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.5rem; }
.ahe .ahe-hop {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.86rem;
    word-break: break-all;
}
.ahe .ahe-hop code { color: var(--brand-dark); background: none; }

/* Groupes d'en-tetes. */
.ahe .ahe-groupe {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.8rem;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.9rem;
}
.ahe .ahe-groupe-titre {
    font-weight: 700;
    color: var(--brand-dark);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}
.ahe .ahe-point { display: flex; gap: 0.6rem; padding: 0.4rem 0; align-items: flex-start; }
.ahe .ahe-point + .ahe-point { border-top: 1px dashed rgba(0, 0, 0, 0.06); }
.ahe .ahe-point .ahe-pastille { margin-top: 0.35rem; }
.ahe .ahe-point-corps { flex: 1 1 auto; min-width: 0; }
.ahe .ahe-point-label { font-weight: 600; color: var(--text-primary); font-size: 0.92rem; word-break: break-word; }
.ahe .ahe-point-label code { background: var(--brand-teal-light); color: var(--brand-dark); border-radius: 4px; padding: 0 5px; font-size: 0.86em; }
.ahe .ahe-point-aide { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.15rem; }

/* TTFB : vue initiale / vue repetee. */
.ahe .ahe-ttfb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ahe .ahe-ttfb-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.8rem;
    padding: 1rem 1.2rem;
    text-align: center;
}
.ahe .ahe-ttfb-titre { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.ahe .ahe-ttfb-val { font-size: 1.8rem; font-weight: 700; color: var(--brand-dark); line-height: 1.2; margin: 0.2rem 0; }
.ahe .ahe-ttfb-meta { font-size: 0.82rem; color: var(--text-secondary); }
.ahe .ahe-verdict {
    margin: 0.8rem 0 0;
    padding: 0.6rem 0.9rem;
    background: var(--brand-teal-light);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--brand-dark);
}

/* En-tetes bruts. */
.ahe .ahe-bruts {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 0.6rem;
    padding: 1rem 1.2rem;
    font-size: 0.82rem;
    line-height: 1.55;
    max-height: 340px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.ahe .ahe-bruts code { color: inherit; background: none; }

/* Carte de cross-link (bas de page). */
.ahe .ahe-crosslink {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    background: linear-gradient(135deg, var(--brand-teal-light) 0%, transparent 70%);
}

/* Dark mode. */
[data-theme="dark"] .ahe .form-control { background: #1f2937; color: var(--text-primary); }
[data-theme="dark"] .ahe .kpi-card,
[data-theme="dark"] .ahe .ahe-hop,
[data-theme="dark"] .ahe .ahe-groupe,
[data-theme="dark"] .ahe .ahe-ttfb-card { background: #1f2937; }
[data-theme="dark"] .ahe .ahe-input-group .ahe-input-icone { background: #243244; color: var(--text-primary); }
[data-theme="dark"] .ahe .status-error { background: #3b1f1f; color: #fca5a5; }

@media (max-width: 640px) {
    .ahe .ahe-intro-grid { grid-template-columns: 1fr; }
    .ahe .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .ahe .ahe-ttfb-grid { grid-template-columns: 1fr; }
}
