/* ============================================================
   Fiche SR — Aide à la Désincarcération
   Thème : lisibilité maximale sur tablette / terrain
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue-dark  : #002060;
    --blue-mid   : #003087;
    --blue-light : #0055b3;
    --red        : #cc0000;
    --orange     : #e65c00;
    --green      : #1a7a1a;
    --bg         : #eef2f7;
    --card-bg    : #ffffff;
    --text        : #1a1a2e;
    --muted      : #5a6480;
    --border     : #d0d8e8;
    --shadow     : 0 4px 18px rgba(0,32,96,.13);
    --radius     : 14px;
    --transition : .22s ease;
}

html { font-size: 16px; }

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ---- HEADER ------------------------------------------- */
.header {
    background: var(--blue-dark);
    color: #fff;
    padding: 0 1.5rem;
    box-shadow: 0 3px 14px rgba(0,0,0,.35);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 0;
}

.header-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.header-content h1 {
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: .5px;
    line-height: 1.1;
}

.header-content p {
    font-size: .82rem;
    opacity: .75;
    letter-spacing: .3px;
}

/* ---- CONTENEUR ----------------------------------------- */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

/* ---- ONGLETS DE MODE ----------------------------------- */
.search-tabs {
    display: flex;
    gap: .4rem;
    margin-bottom: .6rem;
}

.search-tab {
    flex: 1;
    padding: .65rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    background: #f5f7fa;
    color: #5a6a7e;
    cursor: pointer;
    transition: background .18s, color .18s, border-color .18s;
    border-bottom-color: var(--border);
}

.search-tab.active {
    background: var(--card-bg);
    color: var(--blue-mid);
    border-color: var(--border);
    border-bottom-color: var(--card-bg);
    position: relative;
    z-index: 1;
    margin-bottom: -2px;
}

.search-tab:hover:not(.active) {
    background: #eef1f5;
    color: var(--blue-dark);
}

/* ---- RECHERCHE ----------------------------------------- */
.search-section {
    background: var(--card-bg);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    padding: 1.8rem 2rem;
    margin-bottom: 1.6rem;
    border-top: none;
}

.wip-notice {
    background: #fff8e1;
    border: 1.5px solid #f0b429;
    border-radius: 8px;
    color: #7a5800;
    font-size: .88rem;
    font-weight: 600;
    padding: .6rem 1rem;
    margin-bottom: 1.2rem;
}

/* ---- SECTION MANUELLE STYLE EURO NCAP ------------------ */
/* Section sans padding interne supplémentaire */
.manual-euroncap-section {
    padding: 0 !important;
    overflow: hidden;
}

/* Étape générique */
.euroncap-step {
    padding: 1.4rem 1.6rem;
}

/* Barre de recherche */
.euroncap-search-wrap {
    display: flex;
    align-items: center;
    gap: .6rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: .9rem;
    margin-bottom: 1.4rem;
}

.euroncap-search-icon {
    font-size: 1.2rem;
    line-height: 1;
    color: #888;
}

.euroncap-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--text-dark);
    background: transparent;
    height: 38px;
}

.euroncap-search-input::placeholder {
    color: #aaa;
}

/* Grille générique */
.euroncap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.euroncap-grid.models-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.euroncap-grid.variants-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Carte générique (grille des marques uniquement) */
.euroncap-card {
    background: #fff;
    border: 1.5px solid #e8ecf0;
    border-radius: 12px;
    padding: 1rem .75rem .85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .45rem;
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s, transform .14s;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
    font-family: inherit;
}

.euroncap-card:hover,
.euroncap-card:focus {
    border-color: var(--blue-mid);
    box-shadow: 0 4px 16px rgba(0, 48, 135, .14);
    transform: translateY(-2px);
    outline: none;
}

/* Logo marque */
.euroncap-card-logo {
    width: 80px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.euroncap-card-logo img {
    max-width: 80px;
    max-height: 52px;
    object-fit: contain;
}

.euroncap-card-initials {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--blue-mid);
}

/* Noms dans la grille marques */
.euroncap-card-name {
    font-size: .82rem;
    font-weight: 600;
    color: #222;
    line-height: 1.25;
}

.euroncap-card-sub {
    font-size: .74rem;
    color: #777;
    line-height: 1.2;
}

/* ---- LISTE MODÈLES GROUPÉS (étape 2) ----------------------------- */
.models-grouped-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.models-group {
    padding: .2rem 0 1rem;
    border-bottom: 1px solid #f0f2f5;
}
.models-group:last-child { border-bottom: none; }

.models-group-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--blue-dark);
    padding: .7rem 0 .6rem;
    letter-spacing: .1px;
}

.models-group-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

/* Carte variante dans la liste modèles */
.variant-thumb-card {
    background: #fff;
    border: 1.5px solid #e8ecf0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
    transition: border-color .18s, box-shadow .18s, transform .14s;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.variant-thumb-card:hover,
.variant-thumb-card:focus {
    border-color: var(--blue-mid);
    box-shadow: 0 4px 14px rgba(0,48,135,.13);
    transform: translateY(-2px);
    outline: none;
}

.vth-img {
    width: 100%;
    height: 110px;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.vth-img img {
    width: 100%;
    height: 110px;
    object-fit: cover;
}

.vth-img.vth-no-img {
    background: #eef1f5;
}

.vth-info {
    padding: .6rem .7rem .7rem;
    display: flex;
    flex-direction: column;
    gap: .18rem;
}

.vth-type {
    font-size: .85rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

.vth-period {
    font-size: .78rem;
    color: #666;
    line-height: 1.2;
}

/* ---- PAGE DÉTAIL (étape 3) --------------------------------------- */
.detail-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-header {
    margin-bottom: .5rem;
}

.detail-car-photo {
    width: 100%;
    height: 180px;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: .8rem;
}

.detail-car-photo img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}

.detail-make-bar {
    display: flex;
    align-items: center;
    gap: .85rem;
    background: #fff;
    border: 1.5px solid #e8ecf0;
    border-radius: 12px;
    padding: .8rem 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.05);
}

.detail-make-logo {
    width: 48px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.detail-make-initial {
    width: 48px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--blue-mid);
    flex-shrink: 0;
}

.detail-make-text {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}

.detail-make-model {
    font-size: .98rem;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-make-sub {
    font-size: .8rem;
    color: #777;
}

.detail-sheets-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .88rem;
    font-weight: 700;
    color: #555;
    padding: .9rem 0 .5rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.detail-sheets-count {
    background: var(--blue-mid);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 10px;
    padding: .1em .5em;
    min-width: 1.4em;
    text-align: center;
}

.detail-sheets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sheet-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    background: #fff;
    border: 1.5px solid #e8ecf0;
    border-radius: 12px;
    padding: .85rem 1rem;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: border-color .18s, box-shadow .16s;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.sheet-entry:hover,
.sheet-entry:focus {
    border-color: var(--blue-mid);
    box-shadow: 0 3px 12px rgba(0,48,135,.12);
    outline: none;
}

.sheet-entry-active {
    border-color: var(--blue-mid);
    background: #f0f5ff;
}

.sheet-entry-left {
    display: flex;
    flex-direction: column;
    gap: .18rem;
    flex: 1;
    min-width: 0;
}

.sheet-entry-name {
    font-size: .9rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.25;
}

.sheet-entry-sub {
    font-size: .78rem;
    color: #666;
    line-height: 1.25;
}

.sheet-entry-right {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
}

/* Icônes carburant */
.fuel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .2px;
    transform: rotate(45deg);
    color: #fff;
}

.fuel-icon span { transform: rotate(-45deg); display: block; }

.fuel-gd     { background: #c0392b; }
.fuel-ev     { background: #1abc9c; }
.fuel-lpg    { background: #27ae60; }
.fuel-hybrid { background: #8e44ad; }
.fuel-h2     { background: #2980b9; }

/* Badge langue */
.lang-badge {
    font-size: .68rem;
    font-weight: 700;
    padding: .2em .5em;
    border-radius: 4px;
    letter-spacing: .3px;
}

.lang-badge.fr {
    background: #1a5fd4;
    color: #fff;
}

.lang-badge.en {
    background: #e0e8f5;
    color: #1a5fd4;
}

/* Breadcrumb / navigation retour */
.euroncap-breadcrumb {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.euroncap-back-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: .35rem .85rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--blue-mid);
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}

.euroncap-back-btn:hover,
.euroncap-back-btn:focus {
    background: #f0f4fb;
    border-color: var(--blue-mid);
    outline: none;
}

.euroncap-breadcrumb-make {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--blue-dark);
}

/* États */
.euroncap-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.5rem 0;
    color: #888;
    font-size: .9rem;
}

.spinner-sm {
    width: 22px;
    height: 22px;
    border: 3px solid #e0e8f5;
    border-top-color: var(--blue-mid);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

.euroncap-error,
.euroncap-no-result {
    grid-column: 1 / -1;
    padding: 1rem 0;
    color: #888;
    font-size: .9rem;
    margin: 0;
}

.euroncap-error { color: var(--red); }


.search-label {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    color: var(--blue-mid);
    margin-bottom: .65rem;
    letter-spacing: .3px;
}

.plate-wrapper {
    display: flex;
    gap: .75rem;
    align-items: center;
    flex-wrap: wrap;
}

.plate-input {
    flex: 1;
    min-width: 200px;
    height: 64px;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: .3rem;
    text-align: center;
    text-transform: uppercase;
    border: 3px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: #f4f8ff;
    color: var(--blue-dark);
    padding: 0 1rem;
}

.plate-input:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 4px rgba(0,85,179,.15);
    background: #fff;
}

.plate-input::placeholder { color: #b0b8cc; letter-spacing: .15rem; }

.search-btn {
    height: 64px;
    padding: 0 2rem;
    font-size: 1.05rem;
    font-weight: 700;
    background: var(--blue-mid);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    white-space: nowrap;
}

.search-btn:hover  { background: var(--blue-light); transform: translateY(-1px); }
.search-btn:active { transform: translateY(0); }
.search-btn:disabled { background: #9aabbf; cursor: not-allowed; transform: none; }

/* ---- CHARGEMENT ---------------------------------------- */
.loading-section {
    text-align: center;
    padding: 2.5rem 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 5px solid var(--border);
    border-top-color: var(--blue-mid);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-section p { color: var(--muted); font-weight: 600; }

/* ---- ERREUR -------------------------------------------- */
.error-section {
    background: #fff5f5;
    border: 2px solid #ffa0a0;
    border-radius: var(--radius);
    padding: 1.5rem 1.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.error-icon { font-size: 1.8rem; }
.error-section p { color: #a00; font-weight: 600; font-size: 1rem; }

/* ---- CARTE VÉHICULE ------------------------------------ */
.vehicle-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.4rem;
}

.vehicle-header {
    background: var(--blue-dark);
    color: #fff;
    padding: 1.1rem 1.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

.vehicle-plate-badge {
    background: #fff;
    color: var(--blue-dark);
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: .22rem;
    padding: .3rem 1rem;
    border-radius: 8px;
    border: 3px solid #7090c0;
}

.vehicle-year-badge {
    font-size: .95rem;
    opacity: .8;
    letter-spacing: .5px;
}

.vehicle-body {
    padding: 1.4rem 1.6rem;
}

.vehicle-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.15));
}

.vehicle-make  { font-size: 1.55rem; font-weight: 900; color: var(--blue-dark); line-height: 1.1; }
.vehicle-model { font-size: 1.15rem; font-weight: 600; color: var(--blue-mid); margin-top: .2rem; }
.vehicle-model-tech { font-size: .8rem; font-weight: 600; color: var(--muted); margin-top: .15rem; text-transform: uppercase; letter-spacing: .4px; }

.model-image {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin: .6rem 0 .2rem;
    background: #eef2f7;
}

.vehicle-details {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}

.detail-item {
    background: #f4f8ff;
    border-radius: 8px;
    padding: .5rem .85rem;
    min-width: 90px;
}

.detail-label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: .15rem;
}

.detail-value { font-size: .95rem; font-weight: 700; color: var(--blue-dark); }

/* ---- ALERTE EV ----------------------------------------- */
.ev-alert {
    margin: 0 1.6rem 1.4rem;
    background: var(--orange);
    color: #fff;
    border-radius: 10px;
    padding: .85rem 1.2rem;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: .2px;
    display: flex;
    align-items: center;
    gap: .6rem;
    line-height: 1.3;
}

.ev-alert-icon { font-size: 1.5rem; flex-shrink: 0; }

/* ---- SECTION FICHE SR ---------------------------------- */
.fiche-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.4rem 1.6rem 1.6rem;
}

.fiche-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--blue-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.fiche-vehicle-hint {
    background: #eef4ff;
    border-left: 4px solid var(--blue-light);
    border-radius: 0 8px 8px 0;
    padding: .6rem 1rem;
    font-size: .92rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin-bottom: 1.1rem;
}

.fiche-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .9rem;
    margin-bottom: .9rem;
}

.fiche-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    padding: 1.2rem 1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: filter var(--transition), transform var(--transition);
    line-height: 1.3;
}

.fiche-btn:hover  { filter: brightness(1.1); transform: translateY(-2px); }
.fiche-btn:active { transform: translateY(0); }

.fiche-btn-red       { background: var(--red);      color: #fff; }
.fiche-btn-blue      { background: var(--blue-mid); color: #fff; }
.fiche-btn-orange    { background: var(--orange);   color: #fff; }
.fiche-btn-green     { background: var(--green);    color: #fff; }
.fiche-btn-euroncap  { background: #006630;         color: #fff; }
.fiche-btn-euroncap-en { background: #004d24;       color: #fff; }

/* Bloc Euro NCAP — affiché en priorité avant la grille */
#euroncapBlock {
    margin-bottom: .9rem;
}

#euroncapBlock .fiche-btn {
    width: 100%;
    margin-bottom: .5rem;
    font-size: 1rem;
}

/* ---- VISIONNEUSE PDF ----------------------------------- */
#pdfViewer {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: .2rem;
}

.pdf-viewer-bar {
    background: #006630;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem 1rem;
    flex-wrap: wrap;
}

.pdf-viewer-label {
    font-size: .88rem;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-viewer-actions {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}

.pdf-action-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff;
    border-radius: 8px;
    padding: .38rem .8rem;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition);
    font-family: inherit;
}

.pdf-action-btn:hover {
    background: rgba(255,255,255,.35);
    color: #fff;
}

/* ---- Visionneuse PDF.js canvas -------------------------------- */
.pdf-canvas-wrap {
    background: #525659;
    min-height: 400px;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    gap: .75rem;
}

.pdf-canvas-wrap canvas {
    display: block;
    max-width: 100%;
    box-shadow: 0 2px 12px rgba(0,0,0,.5);
    background: #fff;
}

.pdf-canvas-loading {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #fff;
    font-size: .95rem;
    padding: 2rem;
}

.pdf-canvas-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #fff;
    padding: 2rem;
    text-align: center;
}

.pdf-canvas-error .pdf-action-btn {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
    font-size: 1rem;
    padding: .75rem 1.5rem;
}

/* ---- Overlay PDF plein écran (PWA) ----------------------------- */
#pdfFsOverlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #525659;
    flex-direction: column;
    /* safe-area pour les encoches iOS */
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
#pdfFsOverlay.open {
    display: flex;
}
.pdf-fs-bar {
    background: var(--blue-dark);
    color: #fff;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    flex-shrink: 0;
}
.pdf-fs-close {
    background: none;
    border: 1px solid rgba(255,255,255,.45);
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    padding: .4rem .85rem;
    border-radius: 8px;
    font-family: inherit;
    flex-shrink: 0;
    transition: background var(--transition);
}
.pdf-fs-close:hover,
.pdf-fs-close:active {
    background: rgba(255,255,255,.25);
}
.pdf-fs-label {
    flex: 1;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pdf-fs-zoom-ctrl {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
}
.pdf-fs-zoom-btn {
    background: none;
    border: 1px solid rgba(255,255,255,.45);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: .3rem .7rem;
    border-radius: 8px;
    font-family: inherit;
    transition: background var(--transition);
    touch-action: manipulation;
}
.pdf-fs-zoom-btn:hover,
.pdf-fs-zoom-btn:active {
    background: rgba(255,255,255,.25);
}
.pdf-fs-zoom-btn:disabled {
    opacity: .35;
    cursor: default;
}
.pdf-fs-zoom-label {
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    min-width: 3rem;
    text-align: center;
}
.pdf-fs-pages {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 1rem 0;
    /* Autoriser le débordement quand zoom > 1 */
    touch-action: pan-x pan-y pinch-zoom;
}
.pdf-fs-pages canvas {
    display: block;
    max-width: 100%;
    box-shadow: 0 2px 12px rgba(0,0,0,.5);
    background: #fff;
}

/* ---- Fallback "aucune fiche" --------------------------- */
.fiche-no-sheet {
    background: #fff8e1;
    border: 1.5px solid var(--orange);
    border-radius: 10px;
    padding: .75rem 1rem;
    font-size: .88rem;
    font-weight: 600;
    color: #7a4800;
    margin-bottom: 1rem;
    text-align: center;
}

.fiche-btn-icon { font-size: 1.8rem; line-height: 1; }

.fiche-btn > span:nth-child(2) {
    font-size: .98rem;
    font-weight: 800;
}

.fiche-btn-sub {
    font-size: .75rem;
    opacity: .82;
    font-weight: 500;
}

.fiche-note {
    font-size: .78rem;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 480px) {
    .fiche-buttons-grid { grid-template-columns: 1fr; }
}

/* ---- BOUTONS ------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: filter var(--transition), transform var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
    padding: .6rem 1.1rem;
    font-size: .88rem;
    white-space: nowrap;
}

.btn:hover  { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--red);      color: #fff; }
.btn-secondary { background: var(--blue-mid); color: #fff; }

/* ---- FOOTER -------------------------------------------- */
.footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--muted);
    font-size: .78rem;
}

/* ---- RESPONSIVE ---------------------------------------- */
@media (max-width: 560px) {
    .container { padding: 1.1rem .85rem 2rem; }

    .search-section { padding: 1.2rem; }

    .plate-wrapper { flex-direction: column; }
    .plate-input, .search-btn { width: 100%; }
    .plate-input { font-size: 1.65rem; height: 58px; }
    .search-btn  { height: 54px; }

    .manual-row { flex-direction: column; }
    .manual-field, .manual-field-year { min-width: 100%; max-width: 100%; }

    .vehicle-header { flex-direction: column; align-items: flex-start; }
    .vehicle-make { font-size: 1.3rem; }

    .fiche-iframe { height: 420px; }
}
