/*
 * ALPHÉA DESIGN SYSTEM 4.0
 * En-tête Premium commun des modules
 */

.alphea-module-header,
.alphea-module-header * {
    box-sizing: border-box;
}

.alphea-module-header {
    --amh-start: #2563eb;
    --amh-end: #38bdf8;

    position: relative;
    isolation: isolate;

    display: grid;
    grid-template-columns:
        minmax(260px, 1fr)
        minmax(340px, .95fr)
        minmax(190px, auto);
    align-items: center;
    gap: 20px;

    margin: 0 0 18px;
    padding: 22px 24px;

    overflow: hidden;

    color: var(--alphea-dark, #17243a);

    background:
        radial-gradient(
            circle at 96% 0,
            rgba(59, 130, 246, .14),
            transparent 32%
        ),
        linear-gradient(
            135deg,
            rgba(255, 255, 255, .99),
            rgba(247, 250, 255, .98)
        );

    border: 1px solid rgba(31, 55, 88, .09);
    border-radius: 24px;

    box-shadow:
        0 18px 48px rgba(15, 35, 71, .07),
        inset 0 1px 0 rgba(255, 255, 255, .95);
}

.alphea-module-header::before {
    content: "";

    position: absolute;
    inset: 18px auto 18px 0;

    width: 4px;

    border-radius: 0 5px 5px 0;

    background:
        linear-gradient(
            180deg,
            var(--amh-start),
            var(--amh-end)
        );
}

.alphea-module-header--candidature {
    --amh-start: #7c3aed;
    --amh-end: #2563eb;
}

.alphea-module-header--intervention {
    --amh-start: #2563eb;
    --amh-end: #38bdf8;
}

.alphea-module-header--immeuble {
    --amh-start: #059669;
    --amh-end: #14b8a6;
}

.alphea-module-header--sinistre {
    --amh-start: #d97706;
    --amh-end: #ef4444;
}

.alphea-module-header__copy {
    min-width: 0;
}

.alphea-module-header__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 8px;

    color: #68778e;

    font-size: 11px;
    font-weight: 850;
    line-height: 1.2;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.alphea-module-header__eyebrow i {
    width: 8px;
    height: 8px;

    flex: 0 0 8px;

    border-radius: 50%;

    background: var(--amh-start);
    box-shadow: 0 0 0 5px rgba(37, 99, 235, .10);
}

.alphea-module-header h1 {
    margin: 0;

    color: #101b31;

    font-size: clamp(25px, 2.4vw, 34px);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -.045em;
}

.alphea-module-header__copy p {
    max-width: 610px;
    margin: 8px 0 0;

    color: #718096;

    font-size: 14px;
    line-height: 1.5;
}

.alphea-module-header__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(105px, 1fr));
    gap: 9px;
}

.alphea-module-header__stat {
    display: flex;
    flex-direction: column;
    justify-content: center;

    min-width: 0;
    min-height: 84px;
    padding: 12px 14px;

    color: #17243a;
    text-decoration: none;

    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(31, 55, 88, .08);
    border-radius: 16px;

    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;
}

a.alphea-module-header__stat:hover {
    transform: translateY(-2px);

    border-color: rgba(37, 99, 235, .20);

    box-shadow:
        0 12px 27px rgba(15, 35, 71, .07);
}

.alphea-module-header__stat small {
    color: #77859a;

    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
}

.alphea-module-header__stat strong {
    margin: 3px 0;

    color: #17243a;

    font-size: 25px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.04em;
}

.alphea-module-header__stat span {
    overflow: hidden;

    color: #8793a4;

    font-size: 11px;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alphea-module-header__stat--danger {
    border-color: rgba(220, 38, 38, .18);
}

.alphea-module-header__stat--danger strong {
    color: #dc2626;
}

.alphea-module-header__stat--warning {
    border-color: rgba(217, 119, 6, .20);
}

.alphea-module-header__stat--warning strong {
    color: #b45309;
}

.alphea-module-header__stat--success {
    border-color: rgba(5, 150, 105, .18);
}

.alphea-module-header__stat--success strong {
    color: #047857;
}

.alphea-module-header__stat--info {
    border-color: rgba(37, 99, 235, .18);
}

.alphea-module-header__stat--info strong {
    color: #1d4ed8;
}

.alphea-module-header__stat--purple {
    border-color: rgba(124, 58, 237, .18);
}

.alphea-module-header__stat--purple strong {
    color: #7c3aed;
}

.alphea-module-header__actions {
    display: flex;
    flex-direction: column;
    gap: 9px;

    min-width: 190px;
}

.alphea-module-header__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    min-height: 45px;
    padding: 0 16px;

    text-decoration: none;

    border-radius: 14px;

    font-size: 12px;
    font-weight: 850;
    line-height: 1.2;

    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.alphea-module-header__action b {
    font: inherit;
}

.alphea-module-header__action:hover {
    transform: translateY(-2px);
}

.alphea-module-header__action--primary {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            #2559db,
            #2563eb
        );

    box-shadow:
        0 12px 25px rgba(37, 99, 235, .21);
}

.alphea-module-header__action--secondary {
    color: #2456c7;

    background: rgba(239, 245, 255, .96);
    border: 1px solid rgba(37, 99, 235, .13);
}

.alphea-module-header__action--quiet {
    color: #475569;

    background: #fff;
    border: 1px solid rgba(31, 55, 88, .10);
}

html[data-alphea-theme="dark"] .alphea-module-header {
    color: #e8eef8;

    background:
        radial-gradient(
            circle at 96% 0,
            rgba(59, 130, 246, .16),
            transparent 32%
        ),
        linear-gradient(
            135deg,
            rgba(17, 28, 46, .99),
            rgba(12, 23, 40, .99)
        );

    border-color: rgba(148, 163, 184, .17);

    box-shadow:
        0 18px 48px rgba(0, 0, 0, .20),
        inset 0 1px 0 rgba(255, 255, 255, .03);
}

html[data-alphea-theme="dark"] .alphea-module-header h1 {
    color: #f4f7fb;
}

html[data-alphea-theme="dark"]
.alphea-module-header__eyebrow,
html[data-alphea-theme="dark"]
.alphea-module-header__copy p {
    color: #91a1b8;
}

html[data-alphea-theme="dark"]
.alphea-module-header__stat {
    color: #e8eef8;

    background: rgba(17, 28, 46, .88);
    border-color: rgba(148, 163, 184, .15);
}

html[data-alphea-theme="dark"]
.alphea-module-header__stat strong {
    color: #f4f7fb;
}

html[data-alphea-theme="dark"]
.alphea-module-header__stat small,
html[data-alphea-theme="dark"]
.alphea-module-header__stat span {
    color: #91a1b8;
}

html[data-alphea-theme="dark"]
.alphea-module-header__action--secondary,
html[data-alphea-theme="dark"]
.alphea-module-header__action--quiet {
    color: #bfdbfe;

    background: rgba(30, 58, 138, .17);
    border-color: rgba(96, 165, 250, .22);
}

@media (max-width: 1280px) {
    .alphea-module-header {
        grid-template-columns: 1fr auto;
    }

    .alphea-module-header__stats {
        grid-column: 1;
    }

    .alphea-module-header__actions {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

@media (max-width: 850px) {
    .alphea-module-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        padding: 20px;
    }

    .alphea-module-header__stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .alphea-module-header__actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);

        width: 100%;
    }
}

@media (max-width: 560px) {
    .alphea-module-header__stats,
    .alphea-module-header__actions {
        grid-template-columns: 1fr;
    }
}

:root {
    --alphea-module-header-ds4: "installed";
}
