:root {
    --agi-lead-navy: #0b1d35;
    --agi-lead-blue: #3858e9;
    --agi-lead-green: #12a94f;
    --agi-lead-muted: #64748b;
    --agi-lead-border: #dce4ef;
}

body.agiicam-lead-open {
    overflow: hidden;
}

.agiicam-lead-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.agiicam-lead-modal.is-open {
    display: flex;
}

.agiicam-lead-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 17, 35, .72);
    backdrop-filter: blur(4px);
}

.agiicam-lead-dialog {
    position: relative;
    width: min(760px, 100%);
    max-height: min(90vh, 820px);
    overflow-y: auto;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(1, 15, 35, .3);
    color: var(--agi-lead-navy);
}

.agiicam-lead-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px 18px;
    border-bottom: 1px solid #edf1f6;
}

.agiicam-lead-kicker {
    color: var(--agi-lead-green);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.agiicam-lead-header h2 {
    margin: 5px 0 0 !important;
    color: var(--agi-lead-navy) !important;
    font-size: clamp(22px, 3vw, 30px) !important;
    line-height: 1.18 !important;
}

.agiicam-lead-close {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--agi-lead-navy);
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}

.agiicam-lead-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 28px 4px;
}

.agiicam-lead-progress span {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border: 2px solid var(--agi-lead-border);
    border-radius: 50%;
    background: #fff;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 800;
}

.agiicam-lead-progress span.is-active {
    border-color: var(--agi-lead-blue);
    background: var(--agi-lead-blue);
    color: #fff;
}

.agiicam-lead-progress i {
    width: min(84px, 13vw);
    height: 2px;
    background: var(--agi-lead-border);
}

#agiicam-lead-form {
    padding: 16px 28px 26px;
}

.agiicam-lead-step {
    display: none;
}

/* Les styles en grille ne doivent jamais annuler l'attribut HTML hidden. */
.agiicam-lead-modal [hidden] {
    display: none !important;
}

.agiicam-lead-step.is-active {
    display: block;
    animation: agiLeadIn .22s ease;
}

@keyframes agiLeadIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.agiicam-lead-step h3,
.agiicam-lead-success h3 {
    margin: 0 0 5px !important;
    color: var(--agi-lead-navy) !important;
    font-size: 21px !important;
    line-height: 1.3 !important;
}

.agiicam-lead-step h3:focus,
.agiicam-lead-success h3:focus {
    outline: none;
}

.agiicam-lead-step > p {
    margin: 0 0 18px;
    color: var(--agi-lead-muted);
    font-size: 14px;
}

.agiicam-lead-fields {
    display: grid;
    gap: 15px;
}

.agiicam-lead-fields.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.agiicam-lead-fields label {
    display: grid;
    gap: 7px;
    margin: 0;
    color: #334155;
    font-size: 13px;
    font-weight: 750;
}

.agiicam-lead-fields label b {
    color: #dc2626;
}

.agiicam-lead-fields input,
.agiicam-lead-fields select,
.agiicam-lead-fields textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 47px;
    margin: 0;
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-weight: 500;
    outline: none;
}

.agiicam-lead-fields textarea {
    min-height: 112px;
    resize: vertical;
}

.agiicam-lead-fields input:focus,
.agiicam-lead-fields select:focus,
.agiicam-lead-fields textarea:focus {
    border-color: var(--agi-lead-blue);
    box-shadow: 0 0 0 3px rgba(56, 88, 233, .12);
}

.agiicam-lead-fields small {
    color: var(--agi-lead-muted);
    font-size: 11px;
    font-weight: 500;
}

.agiicam-lead-consent {
    display: flex !important;
    align-items: flex-start;
    gap: 9px !important;
    padding: 12px;
    border-radius: 10px;
    background: #f8fafc;
}

.agiicam-lead-consent input {
    flex: 0 0 18px;
    width: 18px;
    min-height: 18px;
    margin-top: 2px;
}

.agiicam-lead-error {
    margin-top: 15px;
    padding: 11px 13px;
    border: 1px solid #fecaca;
    border-radius: 9px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
}

.agiicam-lead-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 17px;
    border-top: 1px solid #edf1f6;
}

.agiicam-lead-actions button,
.agiicam-lead-success a,
.agiicam-lead-finish {
    min-height: 45px;
    padding: 11px 20px;
    border: 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.agiicam-lead-actions .primary {
    background: var(--agi-lead-blue);
    color: #fff;
    box-shadow: 0 7px 18px rgba(56, 88, 233, .22);
}

.agiicam-lead-actions .secondary,
.agiicam-lead-finish {
    border: 1px solid var(--agi-lead-border);
    background: #fff;
    color: var(--agi-lead-navy);
}

.agiicam-lead-actions button:disabled {
    cursor: wait;
    opacity: .65;
}

.agiicam-lead-success {
    padding: 40px 30px;
    text-align: center;
}

.agiicam-lead-success-icon {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #dcfce7;
    color: var(--agi-lead-green);
    font-size: 31px;
    font-weight: 900;
}

.agiicam-lead-success p {
    margin: 8px 0;
    color: var(--agi-lead-muted);
}

.agiicam-lead-success a {
    display: inline-flex;
    margin: 14px 5px 0;
    background: var(--agi-lead-green);
    color: #fff;
}

.agiicam-lead-finish {
    margin: 14px 5px 0;
}

.agiicam-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

@media (max-width: 640px) {
    .agiicam-lead-modal {
        align-items: flex-end;
        padding: 0;
    }

    .agiicam-lead-dialog {
        width: 100%;
        max-height: 94vh;
        border-radius: 20px 20px 0 0;
    }

    .agiicam-lead-header {
        padding: 19px 18px 14px;
    }

    .agiicam-lead-progress {
        padding: 16px 18px 2px;
    }

    #agiicam-lead-form {
        padding: 14px 18px 22px;
    }

    .agiicam-lead-fields.two-columns {
        grid-template-columns: 1fr;
    }

    .agiicam-lead-actions {
        position: sticky;
        bottom: 0;
        margin-right: -18px;
        margin-left: -18px;
        padding: 13px 18px;
        background: #fff;
    }

    .agiicam-lead-actions button {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .agiicam-lead-step.is-active {
        animation: none;
    }
}
