/* ============================================================
   PDFTOPRESS — Preflight UI  (thème clair)
   ============================================================ */

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-bg:       #f0f2f8;
    --color-surface:  #ffffff;
    --color-border:   #dde1ee;
    --color-text:     #1a1d2e;
    --color-muted:    #6b7285;
    --color-accent:   #4355ee;
    --color-pass:     #16a34a;
    --color-warn:     #d97706;
    --color-fail:     #dc2626;
    --color-info:     #2563eb;
    --radius:         8px;
    --radius-lg:      12px;
    --shadow:         0 2px 12px rgba(0,0,0,.10);
    --transition:     .2s ease;
}

html { font-size: 15px; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.5;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout ------------------------------------------------ */
.app-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0 40px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.app-header__logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -.02em;
}

.app-header__logo span { color: var(--color-accent); }

.app-header__badge {
    background: rgba(67,85,238,.1);
    color: var(--color-accent);
    border: 1px solid rgba(67,85,238,.25);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
}

.app-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 36px 40px 80px;
}

/* --- Order Card -------------------------------------------- */
.order-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}

.order-card__header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.order-card__icon {
    width: 44px; height: 44px;
    background: rgba(67,85,238,.1);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}

.order-card__title { font-size: 18px; font-weight: 700; }
.order-card__meta  { font-size: 13px; color: var(--color-muted); margin-top: 2px; }

.order-card__components {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.comp-chip {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
}

.comp-chip__name { font-weight: 600; margin-bottom: 4px; }
.comp-chip__spec { color: var(--color-muted); font-size: 12px; line-height: 1.6; }

/* --- Section titre ----------------------------------------- */
.section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--color-muted);
    margin-bottom: 16px;
}

/* --- Drop Zone --------------------------------------------- */
.upload-block { margin-bottom: 32px; }

.upload-block__label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    position: relative;
    background: var(--color-surface);
}

.drop-zone:hover,
.drop-zone--over {
    border-color: var(--color-accent);
    background: rgba(67,85,238,.04);
}

.drop-zone--loaded {
    border-style: solid;
    border-color: var(--color-pass);
    background: rgba(22,163,74,.04);
}

.drop-zone__icon { font-size: 36px; margin-bottom: 12px; }
.drop-zone__text { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.drop-zone__hint { font-size: 13px; color: var(--color-muted); }
.drop-zone__filename {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-pass);
}

.drop-zone input[type=file] {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer;
    width: 100%; height: 100%;
}

/* --- Results Panel ----------------------------------------- */
.results-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 16px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}

.results-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.results-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.results-score span {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
}

.results-score small { font-size: 11px; color: var(--color-muted); margin-top: 4px; }
.results-score--pass  span { color: var(--color-pass); }
.results-score--warning span { color: var(--color-warn); }
.results-score--fail  span { color: var(--color-fail); }

.results-summary { display: flex; gap: 8px; flex-wrap: wrap; }

.results-section { padding: 20px 24px; border-bottom: 1px solid var(--color-border); }
.results-section:last-child { border-bottom: none; }
.results-section:has(.checklist--sorted) { padding: 20px; }
.results-section:has(.checklist--tabs)   { padding: 0; }

.results-section__title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Check Row -------------------------------------------- */
.checks-list { display: flex; flex-direction: column; gap: 4px; }

.check-row {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(0,0,0,.015);
    transition: background var(--transition);
}

.check-row:hover { background: rgba(0,0,0,.03); }

.check-row__status { flex-shrink: 0; padding-top: 1px; }

.check-row__body { flex: 1; min-width: 0; }

.check-row__header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.check-label  { font-weight: 500; font-size: 14px; }
.check-value  { font-size: 13px; font-family: 'Fira Code', monospace; color: var(--color-text); background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 4px; }
.check-expected { font-size: 12px; color: var(--color-muted); }
.check-message{ font-size: 13px; color: var(--color-muted); margin-top: 3px; }

.check-details {
    list-style: none;
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}
.check-details li { font-size: 12px; color: var(--color-muted); }

/* Couleurs par statut */
.check-row--fail    { border-left: 3px solid var(--color-fail);    background: rgba(220,38,38,.04); }
.check-row--warning { border-left: 3px solid var(--color-warn);    background: rgba(217,119,6,.04); }
.check-row--pass    { border-left: 3px solid var(--color-pass); }
.check-row--info    { border-left: 3px solid var(--color-info); }

/* --- Badge ------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge--pass    { background: rgba(22,163,74,.12);  color: var(--color-pass); }
.badge--warning { background: rgba(217,119,6,.12);  color: var(--color-warn); }
.badge--fail    { background: rgba(220,38,38,.12);  color: var(--color-fail); }
.badge--info    { background: rgba(37,99,235,.12);  color: var(--color-info); }
.badge--pending { background: rgba(0,0,0,.07);       color: var(--color-muted); }

/* --- Tags -------------------------------------------------- */
.tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.tag--server { background: rgba(67,85,238,.12); color: var(--color-accent); }
.tag--local  { background: rgba(22,163,74,.12); color: var(--color-pass);   }

/* --- Spinner legacy (conservé pour compatibilité) ---------- */
.results-loading {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; padding: 32px; color: var(--color-muted); font-size: 14px;
}
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
.spinner--small { width: 20px; height: 20px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Analysis Loader — loader animé principal -------------- */
.analysis-loader {
    padding: 36px 24px 28px;
    text-align: center;
    background: var(--color-surface);
}

.analysis-loader__icon {
    font-size: 60px;
    display: block;
    margin: 0 auto 14px;
    line-height: 1;
    animation: loaderBounce 1.8s ease-in-out infinite;
    transition: opacity .15s ease;
    user-select: none;
}

.analysis-loader__icon.loader-icon--swap {
    opacity: 0;
    transform: scale(.7);
    transition: opacity .15s ease, transform .15s ease;
}

@keyframes loaderBounce {
    0%, 100% { transform: translateY(0) rotate(-2deg) scale(1);   }
    30%       { transform: translateY(-10px) rotate(3deg) scale(1.08); }
    60%       { transform: translateY(-4px) rotate(-1deg) scale(1.03);  }
}

.analysis-loader__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 18px;
}

.analysis-loader__bar {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
    max-width: 340px;
    margin: 0 auto 18px;
}

.analysis-loader__bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-accent), #818cf8, var(--color-accent));
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width .6s cubic-bezier(.4,0,.2,1);
    animation: barShimmer 2s linear infinite;
}

@keyframes barShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.analysis-loader__message {
    font-size: 13px;
    color: var(--color-muted);
    min-height: 38px;
    max-width: 400px;
    margin: 0 auto 10px;
    line-height: 1.6;
    transition: opacity .28s ease, transform .28s ease;
    font-style: italic;
}

.analysis-loader__message.loader-msg--out {
    opacity: 0;
    transform: translateY(6px);
}

.analysis-loader__timer {
    font-family: 'Fira Code', monospace;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: .04em;
}

/* Version compacte pour la section checks avancés */
.analysis-loader--compact {
    padding: 16px 12px;
    text-align: left;
}

.analysis-loader__row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analysis-loader__icon--sm {
    font-size: 28px;
    display: inline-block;
    flex-shrink: 0;
    animation: loaderBounce 1.8s ease-in-out infinite;
    margin: 0;
}

.analysis-loader__col {
    flex: 1;
    min-width: 0;
}

.analysis-loader__message--sm {
    font-size: 12px;
    min-height: 18px;
    margin: 4px 0 0;
    max-width: none;
}

.analysis-loader__timer--sm {
    font-size: 13px;
    flex-shrink: 0;
    color: var(--color-accent);
    font-family: 'Fira Code', monospace;
    font-weight: 700;
}

/* Badge temps écoulé dans le header résultats */
.elapsed-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(67,85,238,.1);
    color: var(--color-accent);
    font-family: 'Fira Code', monospace;
    white-space: nowrap;
}

/* --- Email Form -------------------------------------------- */
.email-form {
    background: rgba(67,85,238,.05);
    border: 1px solid rgba(67,85,238,.18);
    border-radius: var(--radius-lg);
    margin: 16px 24px 24px;
    padding: 24px;
}

.email-form__title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.email-form__desc  { font-size: 13px; color: var(--color-muted); margin-bottom: 16px; line-height: 1.6; }

.form-row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

.form-input {
    flex: 1;
    min-width: 180px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
}

.form-input:focus { border-color: var(--color-accent); }
.form-input::placeholder { color: var(--color-muted); }

/* --- Buttons ----------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
}

.btn:hover  { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
    background: var(--color-accent);
    color: #fff;
}

/* --- Banners ---------------------------------------------- */
.error-banner {
    background: rgba(220,38,38,.08);
    border: 1px solid rgba(220,38,38,.25);
    color: var(--color-fail);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
}

.success-banner {
    background: rgba(22,163,74,.08);
    border: 1px solid rgba(22,163,74,.25);
    color: var(--color-pass);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
}

/* --- Notifications ---------------------------------------- */
.notif {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 12px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 14px;
    z-index: 9999;
    animation: slideIn .25s ease;
    transition: opacity .4s, transform .4s;
}

.notif--error  { border-color: rgba(220,38,38,.35); color: var(--color-fail); }
.notif--out    { opacity: 0; transform: translateY(10px); }

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

/* --- Check block (3 états) --------------------------------- */
.check-block { margin-bottom: 40px; }

.check-block--free .check-block__upload {
    max-width: 580px;
    margin: 0 auto;
    padding: 40px 0 20px;
}

/* --- Upload hero (mode libre) ------------------------------ */
.upload-hero {
    text-align: center;
    margin-bottom: 28px;
}
.upload-hero__icon  { font-size: 52px; line-height: 1; margin-bottom: 16px; display: block; }
.upload-hero__title { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 10px; }
.upload-hero__sub   { font-size: 15px; color: var(--color-muted); line-height: 1.6; }

/* --- Bouton start ------------------------------------------ */
.btn--start {
    display: block;
    width: 100%;
    margin: 20px 0 0;
    padding: 17px 24px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .01em;
    border-radius: 12px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(67,85,238,.3);
    transition: opacity .2s, transform .2s, box-shadow .2s;
}
.btn--start:disabled {
    opacity: .35;
    cursor: not-allowed;
    box-shadow: none;
    transform: none !important;
}
.btn--start:not(:disabled):hover  { opacity: .9; transform: translateY(-2px); box-shadow: 0 8px 28px rgba(67,85,238,.4); }
.btn--start:not(:disabled):active { transform: translateY(0); }

/* --- Checklist temps-réel ---------------------------------- */
.check-block__progress { padding: 8px 0; }

.checklist {
    max-width: 640px;
    margin: 16px auto 0;
    padding: 0 4px;
}
/* En mode grille, pas de contrainte de largeur */
.checklist--sorted { max-width: none; margin: 0; padding: 0; }

.checklist-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 10px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 5px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.checklist-item__icon  { font-size: 14px; font-weight: 700; flex-shrink: 0; width: 18px; text-align: center; }
.checklist-item__label { flex: 1; font-weight: 500; min-width: 0; }
.checklist-item__value {
    font-size: 11px;
    font-family: 'Fira Code', monospace;
    background: rgba(0,0,0,.06);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--color-muted);
    flex-shrink: 0;
}
.checklist-item--pass    .checklist-item__icon { color: var(--color-pass); }
.checklist-item--warning .checklist-item__icon { color: var(--color-warn); }
.checklist-item--fail    .checklist-item__icon { color: var(--color-fail); }
.checklist-item--info    .checklist-item__icon { color: var(--color-info); }

/* Chevron & expand */
.checklist-item__chevron {
    flex-shrink: 0;
    font-size: 16px;
    color: var(--color-muted);
    line-height: 1;
    display: none;
    transition: transform .25s ease;
    margin-left: 2px;
    user-select: none;
}
.checklist-item--clickable { cursor: pointer; }
.checklist-item--clickable:hover { background: rgba(0,0,0,.03); }
.checklist-item--clickable .checklist-item__chevron { display: inline; }
.checklist-item--open .checklist-item__chevron { transform: rotate(90deg); }

/* Expandable detail panel */
.checklist-item__detail {
    flex: 0 0 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
    padding: 0 0 0 28px; /* indent past icon */
}
.checklist-item--open .checklist-item__detail { max-height: 800px; padding: 8px 0 4px 28px; }

.item-detail__message {
    font-size: 12px;
    color: var(--color-muted);
    line-height: 1.55;
    margin-bottom: 5px;
}
.item-detail__message--empty { font-style: italic; }

.item-detail__row {
    display: flex;
    gap: 8px;
    font-size: 11px;
    margin-bottom: 3px;
    align-items: baseline;
    flex-wrap: wrap;
}
.item-detail__key {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--color-muted);
    min-width: 70px;
}
.item-detail__val {
    font-family: 'Fira Code', monospace;
    color: var(--color-text);
    word-break: break-word;
}

/* Vignettes — pages avec images basse résolution */
.item-detail__thumbs {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}
.item-detail__thumbs-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-muted);
    margin-bottom: 8px;
}
.item-detail__thumb-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.item-detail__thumb {
    margin: 0;
    text-align: center;
}
.item-detail__thumb img {
    display: block;
    max-width: 90px;
    height: auto;
    border-radius: 4px;
    border: 2px solid var(--color-fail, #dc2626);
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.item-detail__thumb figcaption {
    font-size: 10px;
    color: var(--color-muted);
    margin-top: 4px;
}

/* Knowledge blocks — 3 colonnes */
.item-detail__knowledge {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    border-top: 1px solid var(--color-border);
    padding-top: 10px;
}

@media (max-width: 700px) {
    .item-detail__knowledge { grid-template-columns: 1fr; }
}

.item-detail__know-block { display: flex; flex-direction: column; gap: 5px; }

.item-detail__know-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-radius: 4px;
    display: inline-block;
    padding: 1px 7px;
    align-self: flex-start;
}
.item-detail__know-label--explain { background: rgba(37,99,235,.1);  color: var(--color-info); }
.item-detail__know-label--impact  { background: rgba(217,119,6,.1);  color: var(--color-warn); }
.item-detail__know-label--fix     { background: rgba(22,163,74,.1);  color: var(--color-pass); }

.item-detail__know-text {
    font-size: 12px;
    color: var(--color-muted);
    line-height: 1.6;
    margin: 0;
}

/* --- Onglets de checks (live + résultats) ──────────────── */
.checklist--tabs {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 0;
}

.live-score-bar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.live-score-top {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.live-filename {
    font-size: 13px;
    color: var(--color-muted);
    line-height: 1.5;
    margin-bottom: 4px;
}

.live-filename__name {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    word-break: break-all;
    letter-spacing: -.01em;
}

/* Progress bar style Apple */
.inline-progress { display: flex; flex-direction: column; gap: 5px; }

.inline-progress__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--color-muted);
}

.inline-progress__label {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-progress__count {
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    font-size: 10px;
    color: var(--color-accent);
    background: rgba(67,85,238,.08);
    padding: 1px 7px;
    border-radius: 10px;
    flex-shrink: 0;
    margin-left: 10px;
}

.inline-progress__track {
    height: 6px;
    background: rgba(0,0,0,.08);
    border-radius: 100px;
    overflow: hidden;
}

.inline-progress__fill {
    position: relative;
    overflow: hidden;
    height: 100%;
    width: 0%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--color-accent), #818cf8);
    transition: width .5s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 0 6px rgba(67,85,238,.35);
}

.inline-progress__fill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    animation: progress-shimmer 1.4s ease-in-out infinite;
}

@keyframes progress-shimmer {
    0%   { left: -60%; }
    100% { left: 160%; }
}

.inline-progress__fill--warning {
    background: linear-gradient(90deg, var(--color-warn), #f59e0b);
    box-shadow: 0 0 6px rgba(217,119,6,.35);
}

.inline-progress__fill--pass {
    background: linear-gradient(90deg, var(--color-pass), #22c55e);
    box-shadow: 0 0 6px rgba(22,163,74,.35);
}

.tab-bar {
    display: flex;
    gap: 4px;
    padding: 12px 16px 0;
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-border);
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px 11px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-bottom: -2px;
    background: rgba(0,0,0,.04);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-muted);
    cursor: pointer;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
    white-space: nowrap;
}

.tab-btn:hover:not(.tab-btn--active) { background: rgba(0,0,0,.07); color: var(--color-text); }

.tab-btn--active {
    background: var(--color-surface);
    border-color: var(--color-border);
    border-bottom-color: var(--color-surface);
}

.tab-btn--active[data-tab="ok"]      { color: var(--color-pass); }
.tab-btn--active[data-tab="info"]    { color: var(--color-info); }
.tab-btn--active[data-tab="warning"] { color: var(--color-warn); }
.tab-btn--active[data-tab="scope"]   { color: var(--color-muted); }

.tab-btn__icon--ok      { color: var(--color-pass); }
.tab-btn__icon--info    { color: var(--color-info); }
.tab-btn__icon--warning { color: var(--color-warn); }
.tab-btn__icon--scope   { color: var(--color-muted); font-size: 16px; }

.tab-btn__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,0,0,.07);
    color: var(--color-muted);
    transition: background var(--transition), color var(--transition);
}

.tab-btn--active[data-tab="ok"]      .tab-btn__count { background: rgba(22,163,74,.15);  color: var(--color-pass); }
.tab-btn--active[data-tab="info"]    .tab-btn__count { background: rgba(37,99,235,.15);  color: var(--color-info); }
.tab-btn--active[data-tab="warning"] .tab-btn__count { background: rgba(217,119,6,.15);  color: var(--color-warn); }

.tab-panel { display: none; }
.tab-panel--active { display: block; }

/* ── Panneau Hors périmètre ───────────────────────────────── */
.scope-panel {
    padding: 18px 20px 24px;
}
.scope-panel__intro {
    font-size: 13px;
    color: var(--color-muted);
    margin: 0 0 18px;
    line-height: 1.6;
    border-left: 3px solid var(--color-border);
    padding-left: 12px;
}
.scope-panel__cat {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-muted);
    margin: 16px 0 6px;
}
.scope-panel__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.scope-panel__list li {
    font-size: 13px;
    color: var(--color-text);
    padding: 5px 10px 5px 24px;
    position: relative;
    border-radius: 4px;
    background: var(--color-bg-alt, rgba(0,0,0,.02));
}
.scope-panel__list li::before {
    content: '✕';
    position: absolute;
    left: 7px;
    color: var(--color-muted);
    font-size: 10px;
    top: 7px;
}
.scope-panel__footer {
    margin: 20px 0 0;
    font-size: 12px;
    color: var(--color-muted);
    font-style: italic;
}

/* Items inside panels: no margin, flush borders */
.tab-panel .checklist-item { margin-bottom: 0; border-radius: 0; border: none; border-bottom: 1px solid rgba(0,0,0,.05); box-shadow: none; }
.tab-panel .checklist-item:last-child { border-bottom: none; }
.tab-panel__proverb {
    padding: 28px 20px;
    text-align: center;
    font-size: 13px;
    font-style: italic;
    color: var(--color-muted);
    line-height: 1.6;
    opacity: 0;
    animation: proverb-fade 0.6s ease 0.3s forwards;
}
@keyframes proverb-fade {
    to { opacity: 1; }
}


/* --- CTAs résultats ---------------------------------------- */
.results-ctas {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 32px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}
.results-ctas--secondary {
    padding: 16px 24px;
    border-top: none;
}

/* ── Gate prospect inline ──────────────────────────────────── */
.prospect-gate {
    margin: 0;
    padding: 28px 28px 24px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
.prospect-gate__form-wrap { display: flex; flex-direction: column; gap: 14px; }
.prospect-gate__title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.4;
}
.prospect-gate__desc {
    font-size: 14px;
    color: rgba(255,255,255,.65);
    margin: 0;
    line-height: 1.6;
}
.prospect-gate__email {
    background: rgba(255,255,255,.1) !important;
    border-color: rgba(255,255,255,.2) !important;
    color: #fff !important;
    font-size: 15px;
}
.prospect-gate__email::placeholder { color: rgba(255,255,255,.38); }
.prospect-gate__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: rgba(255,255,255,.6);
    cursor: pointer;
    line-height: 1.5;
}
.prospect-gate__consent input[type=checkbox] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
    cursor: pointer;
}
.prospect-gate__consent a { color: rgba(255,255,255,.85); }
.prospect-gate__btn      { align-self: flex-start; }

/* Écran de confirmation après soumission */
.prospect-gate__confirmation { text-align: center; padding: 16px 0 8px; }
.prospect-gate__conf-icon {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 16px;
    display: inline-block;
    animation: rotate-slow 3s linear infinite;
}
@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.prospect-gate__conf-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
}
.prospect-gate__conf-msg   { font-size: 14px; color: rgba(255,255,255,.7); margin: 0 0 10px; line-height: 1.6; }
.prospect-gate__conf-email { font-size: 16px; color: #a5b4fc; font-weight: 600; margin: 0 0 12px; }
.prospect-gate__conf-sub   { font-size: 12px; color: rgba(255,255,255,.4); margin: 0; }

/* ── Bouton CTA prospect dans la barre de score ────────────── */
.btn--prospect-header {
    flex-shrink: 0;
    margin-left: auto;
    padding: 14px 28px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s, transform .1s;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.btn--prospect-header:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.btn--prospect-header:disabled { opacity: .65; cursor: default; background: #4b5563; }

/* ── Overlay + modal prospect ──────────────────────────────── */
.prospect-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    padding: 16px;
}
.prospect-modal-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}
body.modal-open { overflow: hidden; }

.prospect-modal {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    border-radius: 16px;
    padding: 40px 44px 36px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    text-align: center;
    animation: modalIn .25s ease;
}
@keyframes modalIn {
    from { transform: translateY(16px) scale(.97); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.prospect-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255,255,255,.5);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    transition: color .15s;
}
.prospect-modal__close:hover { color: #fff; }
.prospect-modal__icon  { font-size: 40px; line-height: 1; margin-bottom: 12px; }
.prospect-modal__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #fff;
}
.prospect-modal__desc {
    font-size: 14px;
    color: rgba(255,255,255,.7);
    margin: 0 0 24px;
    line-height: 1.6;
}
.prospect-modal__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.prospect-modal__email {
    background: rgba(255,255,255,.1) !important;
    border-color: rgba(255,255,255,.25) !important;
    color: #fff !important;
    font-size: 15px;
}
.prospect-modal__email::placeholder { color: rgba(255,255,255,.4); }
.prospect-modal__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    font-size: 12px;
    color: rgba(255,255,255,.6);
    cursor: pointer;
    line-height: 1.5;
}
.prospect-modal__consent input[type=checkbox] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
    cursor: pointer;
}
.prospect-modal__consent a { color: rgba(255,255,255,.85); }

.btn--prospect-cta {
    padding: 15px 28px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
}
.btn--prospect-cta:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.btn--prospect-cta:disabled { opacity: .55; cursor: not-allowed; }

/* Succès dans le modal */
.prospect-modal__success { text-align: center; padding: 12px 0; }
.prospect-modal__success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(99,214,115,.18);
    color: #63d673;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}
.prospect-modal__success-msg  { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.prospect-modal__success-sub  { font-size: 13px; color: rgba(255,255,255,.65); margin: 0; }

.btn--cta-email {
    width: 100%;
    max-width: 440px;
    padding: 18px 28px;
    font-size: 17px;
    font-weight: 800;
    border-radius: 14px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(67,85,238,.3);
    transition: opacity .2s, transform .2s;
    letter-spacing: .01em;
}
.btn--cta-email:hover { opacity: .9; transform: translateY(-2px); }
.btn--cta-email:active { transform: translateY(0); }

.btn--cta-restart {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 22px;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}
.btn--cta-restart:hover { color: var(--color-text); border-color: var(--color-muted); }

/* Zone email (repliable) */
.email-wrap {
    padding: 0 24px 24px;
    background: var(--color-bg);
}

/* --- 3-column results layout ------------------------------ */
.checks-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.checks-col {
    background: var(--color-surface);
    border-radius: 10px;
    border: 1px solid var(--color-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.checks-col--ok      { border-top: 3px solid var(--color-pass); }
.checks-col--warning { border-top: 3px solid var(--color-warn); }
.checks-col--fail    { border-top: 3px solid var(--color-fail); }

.checks-col__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
    font-weight: 600;
    background: var(--color-bg);
}

.checks-col--ok      .checks-col__header { color: var(--color-pass); }
.checks-col--warning .checks-col__header { color: var(--color-warn); }
.checks-col--fail    .checks-col__header { color: var(--color-fail); }

.checks-col__icon { font-size: 16px; }

.checks-col__title { flex: 1; }

.checks-col__count {
    font-size: 11px;
    font-weight: 700;
    opacity: .65;
    background: rgba(0,0,0,.07);
    border-radius: 10px;
    padding: 2px 7px;
}

.checks-col__body {
    flex: 1;
    padding: 6px 0;
}

.checks-col__empty {
    padding: 16px 14px;
    font-size: 12px;
    color: var(--color-muted);
    text-align: center;
    font-style: italic;
}

/* Compact check row (used inside columns) */
.check-row-slim {
    padding: 7px 14px;
    border-bottom: 1px solid rgba(0,0,0,.05);
    transition: background .15s;
}

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

.check-row-slim:hover { background: rgba(0,0,0,.03); }

.check-row-slim__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
}

.check-row-slim .check-value   { font-size: 11px; }
.check-row-slim .check-message { font-size: 11px; margin-top: 2px; }
.check-row-slim .check-details { margin-top: 4px; }
.check-row-slim .check-details li { font-size: 11px; }


/* --- Progression checks avancés --------------------------- */
.adv-progress {
    margin-top: 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 16px;
}

.adv-progress__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.adv-progress__bar-wrap {
    flex: 1;
    height: 5px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
}

.adv-progress__bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), #818cf8);
    border-radius: 3px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
}

.adv-progress__label {
    font-size: 12px;
    color: var(--color-muted);
    white-space: nowrap;
    font-family: 'Fira Code', monospace;
}

.adv-progress__checks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.adv-progress__item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--color-muted);
    transition: color .2s;
}

.adv-progress__item-icon { font-size: 13px; }

.adv-progress__item--pass    { color: var(--color-pass); }
.adv-progress__item--info    { color: var(--color-info); }
.adv-progress__item--warning { color: var(--color-warn); }
.adv-progress__item--fail    { color: var(--color-fail); }

/* --- Responsive ------------------------------------------- */
@media (max-width: 600px) {
    .tab-btn__label { display: none; }
}
@media (max-width: 1100px) {
    .checks-columns { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .app-main { padding: 24px 16px 60px; }
    .results-header { flex-direction: column; align-items: flex-start; }
    .form-row { flex-direction: column; }
    .form-input { min-width: unset; }
}

/* ── Bande de vignettes en bas ───────────────────────────────── */
.page-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 14px 16px 12px;
    border-top: 1px solid var(--color-border);
    background: #f4f5f9;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}
.page-strip:empty {
    display: none;
}
.page-strip__thumb {
    flex-shrink: 0;
    margin: 0;
    text-align: center;
}
.page-strip__thumb img {
    display: block;
    height: 200px;
    width: auto;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 5px rgba(0,0,0,.14);
}
.page-strip__thumb figcaption {
    font-size: 10px;
    color: var(--color-muted);
    margin-top: 5px;
}
.page-strip__more {
    flex-shrink: 0;
    align-self: center;
    font-size: 12px;
    color: var(--color-muted);
    padding: 0 8px;
}

/* Vignettes avec anomalies */
.page-strip__thumb--fail img {
    border-color: var(--color-fail, #dc2626);
    border-width: 2px;
    box-shadow: 0 0 0 1px var(--color-fail, #dc2626), 0 2px 6px rgba(220,38,38,.25);
}
.page-strip__thumb--warning img {
    border-color: var(--color-warn, #d97706);
    border-width: 2px;
    box-shadow: 0 0 0 1px var(--color-warn, #d97706), 0 2px 6px rgba(217,119,6,.2);
}
.page-strip__thumb--fail figcaption::before {
    content: '● ';
    color: var(--color-fail, #dc2626);
}
.page-strip__thumb--warning figcaption::before {
    content: '● ';
    color: var(--color-warn, #d97706);
}

/* Liste des anomalies sous chaque vignette concernée */
.page-strip__issues {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    text-align: left;
    max-width: 140px;
}
.page-strip__issues li {
    font-size: 9px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 10px;
    position: relative;
}
.page-strip__issues li::before {
    content: '–';
    position: absolute;
    left: 2px;
}
.page-strip__issues--fail li    { color: var(--color-fail, #dc2626); }
.page-strip__issues--warning li { color: var(--color-warn, #d97706); }
