/* ============================================
   SEO AUDIT - Revolucy Design System
   ============================================ */

#header-seo-audit.header-realisation-details {
    padding-top: 14vw;
    padding-bottom: 20vw;
}

#header-seo-audit .audit-hero-row {
    padding-block: clamp(48px, 8vh, 100px);
}

#seo-audit.seo-audit-main {
    padding-bottom: clamp(48px, 7vh, 88px);
}

#seo-audit .audit-form-section {
    padding-block: clamp(32px, 5vh, 64px) clamp(24px, 4vh, 48px);
}

#seo-audit #audit-explainer {
    padding-block: clamp(48px, 7vh, 88px) 0;
}

/* Form card */
.audit-form-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 5px 6px 30px 0 var(--color-grey);
}

/* Error */
.alert-audit-error {
    background: #fff0f3;
    border: 1px solid var(--color-pink);
    border-radius: 10px;
}

/* Score section */
.audit-score-section {
    position: relative;
}

.score-ring-container {
    position: relative;
    width: 160px;
    height: 160px;
}

.score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: #e8e8f0;
    stroke-width: 8;
}

.score-ring-fg {
    fill: none;
    stroke: var(--color-green);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out, stroke 0.3s;
}

.score-ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: 800;
    font-family: "Tektur", "Tektur Fallback", sans-serif;
}

/* Stat cards */
.audit-stat-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 2px 3px 15px 0 var(--color-grey);
    padding: 15px 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audit-stat-card .stat-number {
    font-size: 28px;
    color: var(--color-blue);
}

.audit-stat-card.passed .stat-number {
    color: #00c853;
}

.audit-stat-card.failed .stat-number {
    color: #f44336;
}

.audit-stat-card .stat-label {
    font-size: 12px;
    color: var(--color-dark-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* PDF button */
.btn-custom-blue {
    background: var(--color-blue);
    color: var(--color-white);
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-custom-blue:hover {
    background: #0614a0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(8, 24, 175, 0.3);
}

/* Section titles */
.audit-section-title {
    font-size: 24px;
    border-bottom: 3px solid var(--color-green);
    padding-bottom: 8px;
    display: inline-block;
}

/* Priority actions */
.priority-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: #fff5f5;
    border-left: 4px solid #f44336;
    border-radius: 0 8px 8px 0;
    padding: 15px 20px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}

.priority-card:hover {
    transform: translateX(4px);
}

.priority-card.warn {
    background: #fff8e1;
    border-left-color: #ff9800;
}

.priority-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}

.priority-content {
    flex: 1;
}

.priority-label {
    font-size: 14px;
    color: var(--color-black);
}

.priority-hint {
    font-size: 12px;
    color: var(--color-dark-grey);
    margin-top: 2px;
}

.priority-reco {
    font-size: 13px;
    color: #555;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

/* Category bars */
.cat-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.cat-bar-label {
    width: 180px;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--color-black);
}

.cat-bar-track {
    flex: 1;
    height: 12px;
    background: #e8e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.cat-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease-out;
}

.cat-bar-score {
    width: 50px;
    text-align: right;
    font-size: 14px;
    flex-shrink: 0;
}

.cat-bar-detail {
    width: 60px;
    text-align: right;
    font-size: 11px;
    color: var(--color-dark-grey);
    flex-shrink: 0;
}

/* Keywords cloud */
.kw-tag {
    display: inline-block;
    background: #f0f2ff;
    color: var(--color-blue);
    padding: 5px 12px;
    border-radius: 20px;
    margin: 4px;
    font-weight: 500;
    transition: transform 0.2s, background 0.2s;
}

.kw-tag:hover {
    background: var(--color-blue);
    color: var(--color-white);
    transform: scale(1.05);
}

.kw-tag small {
    opacity: 0.7;
}

/* Detail accordion */
.audit-cat-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 2px 3px 15px 0 var(--color-grey);
    margin-bottom: 12px;
    overflow: hidden;
}

.audit-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    gap: 10px;
}

.audit-cat-header:hover {
    background: #fafafe;
}

.audit-cat-header span:first-child {
    flex: 1;
    font-size: 15px;
    color: var(--color-black);
}

.audit-cat-badge {
    display: inline-block;
    color: var(--color-white);
    font-size: 13px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    min-width: 50px;
    text-align: center;
}

.audit-cat-chevron {
    font-size: 12px;
    color: var(--color-dark-grey);
    transition: transform 0.3s;
}

.audit-cat-header[aria-expanded="true"] .audit-cat-chevron {
    transform: rotate(180deg);
}

.audit-cat-body {
    padding: 0 20px 15px;
}

/* Check rows */
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f5;
}

.check-row:last-child {
    border-bottom: none;
}

.check-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    line-height: 1.4;
}

.check-pass .check-icon { color: #00c853; }
.check-warn .check-icon { color: #ff9800; }
.check-fail .check-icon { color: #f44336; }

.check-content {
    flex: 1;
}

.check-label {
    font-size: 13px;
    color: var(--color-black);
    font-weight: 500;
}

.check-hint {
    font-size: 12px;
    color: var(--color-dark-grey);
    margin-top: 2px;
}

.check-reco {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
    padding: 6px 10px;
    background: #fafafe;
    border-radius: 4px;
    border-left: 2px solid var(--color-blue);
}

/* Tech table */
.tech-table {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 2px 3px 15px 0 var(--color-grey);
    overflow: hidden;
}

.tech-row {
    display: flex;
    border-bottom: 1px solid #f0f0f5;
}

.tech-row:last-child {
    border-bottom: none;
}

.tech-key {
    width: 180px;
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--color-blue);
    background: #fafafe;
}

.tech-val {
    flex: 1;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--color-black);
    word-break: break-all;
}

/* Headings tree */
.heading-item {
    padding: 6px 10px;
    border-left: 3px solid var(--color-green);
    margin-bottom: 4px;
    font-size: 13px;
    background: #fafafe;
    border-radius: 0 6px 6px 0;
}

.heading-item.h1 { margin-left: 0; border-left-color: var(--color-blue); font-weight: 600; }
.heading-item.h2 { margin-left: 20px; border-left-color: var(--color-green); }
.heading-item.h3 { margin-left: 40px; border-left-color: var(--color-purple); }
.heading-item.h4 { margin-left: 60px; border-left-color: var(--color-pink); }
.heading-item.h5 { margin-left: 80px; border-left-color: var(--color-dark-grey); }
.heading-item.h6 { margin-left: 100px; border-left-color: var(--color-grey); }

.heading-tag {
    display: inline-block;
    font-size: 11px;
    color: var(--color-white);
    background: var(--color-blue);
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 8px;
}

.heading-item.h2 .heading-tag { background: #2e7d32; }
.heading-item.h3 .heading-tag { background: var(--color-purple); }
.heading-item.h4 .heading-tag { background: var(--color-pink); }

/* ============================================
   PageSpeed Insights
   ============================================ */

/* PSI Tabs */
.psi-tabs {
    display: flex;
    gap: 8px;
}

.psi-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: 2px solid #e8e8f0;
    border-radius: 8px;
    background: var(--color-white);
    color: var(--color-dark-grey);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.psi-tab:hover {
    border-color: var(--color-blue);
    color: var(--color-blue);
}

.psi-tab.active {
    background: var(--color-blue);
    border-color: var(--color-blue);
    color: var(--color-white);
}

.psi-tab.active svg {
    stroke: var(--color-white);
}

/* PSI Scores Grid (gauges) */
.psi-scores-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.psi-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 130px;
}

.psi-gauge-svg {
    width: 90px;
    height: 90px;
}

.psi-gauge-value {
    font-size: 28px;
    margin-top: -58px;
    margin-bottom: 28px;
    line-height: 1;
}

.psi-gauge-label {
    font-size: 12px;
    color: var(--color-dark-grey);
    text-align: center;
    margin-top: 6px;
}

/* Core Web Vitals rows */
.cwv-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f5;
    background: var(--color-white);
}

.cwv-row:first-of-type {
    border-radius: 8px 8px 0 0;
}

.cwv-row:last-of-type {
    border-radius: 0 0 8px 8px;
    border-bottom: none;
}

.cwv-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.cwv-label {
    flex: 1;
    font-size: 13px;
    color: var(--color-black);
}

.cwv-value {
    font-size: 14px;
    flex-shrink: 0;
}

/* PSI Opportunities */
.psi-opp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid #f0f0f5;
    background: var(--color-white);
    font-size: 13px;
}

.psi-opp-row:first-of-type {
    border-radius: 8px 8px 0 0;
}

.psi-opp-row:last-of-type {
    border-radius: 0 0 8px 8px;
    border-bottom: none;
}

.psi-opp-title {
    flex: 1;
    color: var(--color-black);
}

.psi-opp-savings {
    flex-shrink: 0;
    font-weight: 600;
    color: #ff5722;
    font-size: 12px;
    background: #fff3e0;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .cat-bar-row {
        flex-wrap: wrap;
    }

    .cat-bar-label {
        width: 100%;
        margin-bottom: 4px;
    }

    .cat-bar-track {
        order: 1;
        flex: 1;
    }

    .cat-bar-score {
        order: 2;
    }

    .cat-bar-detail {
        order: 3;
    }

    .tech-row {
        flex-direction: column;
    }

    .tech-key {
        width: 100%;
    }

    .heading-item.h2 { margin-left: 10px; }
    .heading-item.h3 { margin-left: 20px; }
    .heading-item.h4 { margin-left: 30px; }
    .heading-item.h5 { margin-left: 40px; }
    .heading-item.h6 { margin-left: 50px; }

    .priority-card {
        flex-direction: column;
        gap: 8px;
    }

    .score-ring-container {
        width: 130px;
        height: 130px;
    }

    .score-ring-value {
        font-size: 34px;
    }

    .psi-scores-grid {
        gap: 12px;
    }

    .psi-gauge {
        width: 100px;
    }

    .psi-gauge-svg {
        width: 70px;
        height: 70px;
    }

    .psi-gauge-value {
        font-size: 22px;
        margin-top: -46px;
        margin-bottom: 22px;
    }

    .psi-tabs {
        flex-wrap: wrap;
    }

    .psi-tab {
        flex: 1;
        justify-content: center;
        padding: 8px 16px;
        font-size: 13px;
    }

    .cwv-row {
        flex-wrap: wrap;
    }

    .cwv-label {
        font-size: 12px;
    }
}

/* ============================================
   LOADER AVEC JAUGE DE PROGRESSION
   ============================================ */
.audit-loader-card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 5px 6px 30px 0 var(--color-grey);
}

.loader-icon-container {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-pulse {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-green);
    animation: loader-pulse-anim 1.4s ease-in-out infinite;
    position: relative;
    box-shadow: 0 0 0 0 var(--color-green);
}

.loader-pulse::before,
.loader-pulse::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid var(--color-green);
    opacity: 0;
    animation: loader-ring-anim 1.8s ease-out infinite;
}

.loader-pulse::after {
    animation-delay: 0.9s;
}

@keyframes loader-pulse-anim {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.85); opacity: 0.85; }
}

@keyframes loader-ring-anim {
    0% { transform: scale(0.9); opacity: 0.8; }
    100% { transform: scale(2.3); opacity: 0; }
}

.loader-progress-wrap {
    max-width: 520px;
    margin: 0 auto;
}

.loader-progress-bar {
    width: 100%;
    height: 12px;
    background: #e8e8f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.loader-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-green), var(--color-blue));
    border-radius: 10px;
    transition: width 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.loader-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: loader-shine-anim 1.6s linear infinite;
}

@keyframes loader-shine-anim {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================
   MODALE PDF — ÉTATS SUCCÈS / ERREUR
   ============================================ */
.pdf-success-icon {
    width: 64px;
    height: 64px;
}

.pdf-success-circle {
    stroke: #00c853;
    stroke-width: 2.5;
    stroke-dasharray: 150.8;
    stroke-dashoffset: 150.8;
    animation: pdf-success-circle-anim 0.6s ease-out forwards;
}

.pdf-success-check {
    stroke: #00c853;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: pdf-success-check-anim 0.4s ease-out 0.5s forwards;
}

@keyframes pdf-success-circle-anim {
    to { stroke-dashoffset: 0; }
}

@keyframes pdf-success-check-anim {
    to { stroke-dashoffset: 0; }
}

/* =============================================================================
   Ex styles inline convertis en classes (2026-06-11) — !important = précédence
   des anciens style="".
   ============================================================================= */
.sa-row-gap-20 { row-gap: 20px !important; }
.sa-minw-250 { min-width: 250px !important; }
.sa-color-dark-grey { color: var(--color-dark-grey) !important; }
.sa-modal-btn-lg { line-height: 20px !important; padding: 14px 30px 10px 30px !important; }
.sa-modal-btn { line-height: 20px !important; padding: 12px 30px 8px 30px !important; }
.sa-warning-icon { color: var(--color-pink) !important; font-size: 48px !important; }
