/**
 * FICHE-PAIE.FR - Générateur de bulletins de paie
 *
 * @copyright 2025-2026 Purple Telecom EURL
 * @license   Proprietary - All Rights Reserved
 * @author    Fabien HIRIART <contact@polygonlab.ai>
 *
 * CSS externalisé depuis generate.php
 */

/* =====================================================
   FIX MARGE HEADER PAGE /GENERER
   ===================================================== */
html, body, body.page-generer {
    margin: 0 !important;
    padding: 0 !important;
}

body.page-generer > .header,
body.page-generer > header.header,
.page-generer .header:first-of-type {
    margin: 0 !important;
    margin-top: 0 !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    top: 0 !important;
    position: sticky !important;
}

/* =====================================================
   FLATPICKR - BRANDING FICHE-PAIE.FR
   ===================================================== */
.flatpickr-calendar {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: none;
    overflow: visible !important;
    z-index: 999999 !important;
}
.flatpickr-months {
    background: linear-gradient(135deg, var(--gp-bleu-primaire) 0%, #152d5c 100%);
    border-radius: 12px 12px 0 0;
    padding: 8px 0;
}
.flatpickr-months .flatpickr-month {
    color: white;
    fill: white;
    height: 40px;
}
.flatpickr-current-month {
    color: white;
    font-weight: 600;
    font-size: 15px;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
}
.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: rgba(255, 255, 255, 0.25);
}
.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: var(--gp-blanc);
    color: var(--gp-bleu-primaire);
    padding: 8px 12px;
    font-weight: 500;
}
.flatpickr-current-month input.cur-year {
    color: white;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    width: 70px;
    text-align: center;
}
.flatpickr-current-month input.cur-year:hover {
    background: rgba(255, 255, 255, 0.25);
}
.flatpickr-current-month input.cur-year:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}
/* Cacher les spinners du champ année */
.flatpickr-current-month input.cur-year::-webkit-inner-spin-button,
.flatpickr-current-month input.cur-year::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.flatpickr-current-month .numInputWrapper {
    width: auto;
}
.flatpickr-current-month .numInputWrapper span {
    display: none;
}
/* Dropdown année personnalisé - Container */
.flatpickr-year-dropdown-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 10;
    margin-left: 8px;
}
.flatpickr-year-dropdown-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    transition: all 0.2s ease;
}
.flatpickr-year-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
}
.flatpickr-year-dropdown-btn::after {
    content: '▼';
    font-size: 8px;
    opacity: 0.8;
    transition: transform 0.2s ease;
}
.flatpickr-year-dropdown-menu.open + .flatpickr-year-dropdown-btn::after,
.flatpickr-year-dropdown-container:has(.open) .flatpickr-year-dropdown-btn::after {
    transform: rotate(180deg);
}
.flatpickr-year-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 10px;
    box-shadow: 0 -4px 25px rgba(0,0,0,0.3);
    min-width: 90px;
    max-height: 220px;
    overflow-y: auto;
    display: none;
    z-index: 9999999 !important;
    border: 1px solid var(--gp-bordure);
}
.flatpickr-year-dropdown-menu.open {
    display: block;
    animation: slideUp 0.15s ease-out;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.flatpickr-year-dropdown-menu div {
    padding: 10px 18px;
    cursor: pointer;
    color: var(--gp-bleu-primaire);
    font-weight: 500;
    text-align: center;
    transition: all 0.15s ease;
    border-bottom: 1px solid var(--gp-gris-clair);
}
.flatpickr-year-dropdown-menu div:last-child {
    border-bottom: none;
}
.flatpickr-year-dropdown-menu div:hover {
    background: var(--gp-pastille);
    color: var(--gp-bleu-primaire);
}
.flatpickr-year-dropdown-menu div.selected {
    background: var(--gp-success);
    color: white;
    font-weight: 600;
}
.flatpickr-year-dropdown-menu div.selected:hover {
    background: #059669;
    color: white;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: white;
    color: white;
    padding: 8px 12px;
}
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    fill: white;
}
.flatpickr-weekdays {
    background: var(--gp-fond-pale);
    border-bottom: 1px solid #e9ecef;
}
.flatpickr-weekday {
    color: var(--gp-bleu-primaire);
    font-weight: 600;
    font-size: 12px;
}
.flatpickr-days {
    padding: 5px;
}
.flatpickr-day {
    border-radius: 8px;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s ease;
}
.flatpickr-day:hover {
    background: var(--gp-pastille);
    border-color: var(--gp-pastille);
    color: var(--gp-bleu-primaire);
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--gp-success);
    border-color: var(--gp-success);
    border-radius: 50%;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
.flatpickr-day.today {
    border-color: var(--gp-success);
    color: var(--gp-success);
    font-weight: 700;
}
.flatpickr-day.today:hover {
    background: var(--gp-success);
    border-color: var(--gp-success);
    color: white;
}
.flatpickr-day.today.selected {
    background: var(--gp-success);
    border-color: var(--gp-success);
    border-radius: 50%;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #d1d5db;
}
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: var(--gp-gris-clair);
    color: #9ca3af;
}
/* Animation d'ouverture */
.flatpickr-calendar.animate.open {
    animation: flatpickrOpen 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes flatpickrOpen {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
/* =====================================================
   VARIABLES CSS
   ===================================================== */
:root {
    --primary: #1d458c;
    --primary-light: #2a5bb8;
    --primary-dark: #152d5c;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --gray: #6c757d;
    --gray-light: #f8f9fa;
    --border: #dee2e6;
}

/* =====================================================
   LAYOUT PRINCIPAL - SIDEBAR + MAIN
   ===================================================== */
.form-container {
    display: flex;
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: visible;
    min-height: 650px;
}

/* =====================================================
   SIDEBAR GAUCHE
   ===================================================== */
.form-sidebar {
    width: 300px;
    min-width: 300px;
    background: linear-gradient(180deg, var(--gp-bleu-primaire) 0%, var(--primary-dark) 100%);
    padding: 30px 25px;
    color: white;
    display: flex;
    flex-direction: column;
    border-radius: 16px 0 0 16px;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 25px;
}

.sidebar-header h3 {
    font-size: 22px;
    margin: 0 0 5px 0;
    font-weight: 700;
    color: white;
}

.sidebar-header p {
    opacity: 0.7;
    font-size: 14px;
    margin: 0;
}

/* Barre de progression */
.progress-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.progress-bar-sidebar {
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: visible;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gp-success-clair), var(--gp-success));
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

/* Timeline des étapes */
.form-steps {
    position: relative;
    flex: 1;
}

.form-step {
    display: flex;
    align-items: flex-start;
    position: relative;
    padding-left: 55px;
    padding-bottom: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.form-step:last-child {
    padding-bottom: 0;
}

/* Ligne verticale entre les étapes */
.form-step::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 40px;
    width: 2px;
    height: calc(100% - 15px);
    background: rgba(255,255,255,0.25);
}

.form-step:last-child::before {
    display: none;
}

.form-step.completed::before {
    background: var(--gp-success);
}

/* Icône cercle */
.step-icon {
    position: absolute;
    left: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s;
    border: 3px solid rgba(255,255,255,0.3);
    background: transparent;
    color: white;
}

.form-step.completed .step-icon {
    background: var(--gp-success);
    border-color: var(--gp-success);
}

.form-step.active .step-icon {
    background: white;
    color: var(--gp-bleu-primaire);
    border-color: white;
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.form-step.error .step-icon {
    background: var(--danger);
    border-color: var(--danger);
}

.form-step.pending .step-icon {
    opacity: 0.5;
}

/* Contenu étape */
.step-info h4 {
    font-size: 15px;
    margin: 0 0 4px 0;
    opacity: 0.85;
    font-weight: 600;
    color: white;
}

.form-step.active .step-info h4 {
    opacity: 1;
    font-size: 16px;
}

.step-info p {
    font-size: 12px;
    opacity: 0.6;
    margin: 0;
}

.step-status {
    font-size: 11px;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 600;
}

.form-step.completed .step-status {
    background: rgba(40, 167, 69, 0.25);
    color: #7eff7e;
}

.form-step.active .step-status {
    background: rgba(255,255,255,0.2);
    color: white;
}

.form-step.error .step-status {
    background: rgba(220, 53, 69, 0.25);
    color: #ff9999;
}

.form-step.pending .step-status {
    display: none;
}

/* =====================================================
   MAIN CONTENT (DROITE)
   ===================================================== */
.form-main {
    flex: 1;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* Header de l'étape */
.step-header {
    margin-bottom: 32px;
}

.step-header h2 {
    font-size: 1.5rem;
    color: var(--gp-bleu-primaire);
    margin: 0 0 8px 0;
}

.step-header p {
    color: var(--gray);
    margin: 0;
}

/* =====================================================
   ÉTAPE 4 - Header avec KPIs inline
   ===================================================== */
.step4-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 1rem;
    flex-wrap: wrap;
}

.step4-header-wrapper .step-header.step4-title {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.step4-kpis {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.step4-kpi {
    background: linear-gradient(135deg, var(--gp-fond-pale), var(--gp-gris-clair));
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--gp-bleu-primaire);
    min-width: 100px;
    text-align: center;
}

.step4-kpi-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--gp-gris);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.step4-kpi.highlight {
    border-left-color: #059669;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}

.step4-kpi-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gp-bleu-primaire);
    line-height: 1.2;
}

.step4-kpi.highlight .step4-kpi-value {
    color: #059669;
}

.step4-kpi-sub {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 2px;
    line-height: 1.2;
}

/* =====================================================
   FORMULAIRE
   ===================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    overflow: visible;
}

.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid var(--gp-bordure);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gp-bleu-primaire);
    box-shadow: 0 0 0 4px rgba(29, 69, 140, 0.1);
}

.form-group input[readonly] {
    background: var(--gp-fond-pale);
    color: var(--gp-gris);
}

.form-group small {
    /* Lot 30 (A6-15) : gris lisible sur blanc (contraste 4,8 : 1 ; l'ancien gris clair donnait 2,54 : 1) */
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
}

/* Input rempli = fond vert */
.form-group input.filled,
.form-group select.filled {
    border-color: var(--gp-success) !important;
    background: linear-gradient(to right, var(--gp-success-pale), white) !important;
}

/* Input erreur = fond rouge */
.form-group input.input-error,
.form-group select.input-error {
    border-color: var(--danger) !important;
    background: var(--danger-light) !important;
}

/* Auto-filled (via API SIRET) */
.form-group input.auto-filled {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #166534;
}

/* CHECKBOX INLINE STYLEE (Sans sécu) */
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-inline input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: white;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.checkbox-inline input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--gp-bleu-primaire);
    border-color: var(--gp-bleu-primaire);
}

.checkbox-inline input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.checkbox-label {
    font-size: 13px;
    color: var(--gp-gris);
    font-weight: 500;
}

.checkbox-inline:hover .checkbox-custom {
    border-color: var(--gp-bleu-primaire);
}

.no-secu-checkbox {
    margin-top: 10px;
}

.form-group input:disabled {
    background: var(--gp-gris-clair);
    color: #9ca3af;
    border-color: var(--gp-bordure);
    cursor: not-allowed;
}

/* SIRET */
.siret-input-wrapper {
    position: relative;
}

.siret-input-wrapper input {
    padding-right: 40px;
}

.siret-loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gp-bordure);
    border-top-color: var(--gp-bleu-primaire);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
}

.siret-loader.active {
    display: block;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.siret-message {
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.siret-message.siret-success {
    display: block;
    color: #22c55e;
}

.siret-message.siret-error {
    display: block;
    color: #9ca3af;
}

.entreprise-message {
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.entreprise-message.entreprise-error {
    display: block;
    color: #9ca3af;
}

/* Auto-filled */
.form-group input.auto-filled {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #166534;
}

/* Période */
.periode-selects {
    display: flex;
    gap: 12px;
}

.periode-selects select {
    flex: 1;
}

/* ETAPE 4 - Design liste/détails moderne */
.step4-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Accordéon sections */
.step4-accordion {
    border: 1px solid var(--gp-bordure);
    border-radius: 12px;
    overflow: visible;
    background: white;
}

.step4-accordion-item {
    border-bottom: 1px solid var(--gp-bordure);
}

.step4-accordion-item:last-child {
    border-bottom: none;
}

.step4-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--gp-fond-pale);
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.step4-accordion-header:hover {
    background: var(--gp-gris-clair);
}

.step4-accordion-header.open {
    background: var(--gp-pastille);
    border-bottom: 1px solid var(--gp-bordure);
}

.step4-accordion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    flex: 1;              /* Prend tout l'espace disponible */
    min-width: 0;         /* Permet le texte de se tronquer si besoin */
}

.step4-accordion-title svg {
    color: var(--gp-bleu-primaire);
}

.step4-accordion-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 12px;
    background: #ecfdf5;
    color: #059669;
    margin-left: auto;    /* Pousse le badge à droite */
    flex-shrink: 0;       /* Ne rétrécit pas */
    min-width: 100px;     /* Largeur minimale pour alignement vertical */
    text-align: center;   /* Centre le texte dans le badge */
}

.step4-accordion-badge.warning {
    background: #fef3c7;
    color: #d97706;
}

.step4-accordion-badge.info {
    background: var(--gp-pastille);
    color: var(--gp-bleu-primaire);
}

.step4-accordion-arrow {
    transition: transform 0.2s;
    color: var(--gp-gris);
}

.step4-accordion-header.open .step4-accordion-arrow {
    transform: rotate(180deg);
}

.step4-accordion-content {
    display: none;
    padding: 20px;
    background: white;
}

.step4-accordion-content.open {
    display: block;
}

/* Section Récapitulatif */
.recap-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.recap-card {
    background: linear-gradient(135deg, var(--gp-fond-pale), var(--gp-gris-clair));
    border-radius: 10px;
    padding: 16px;
    border-left: 4px solid var(--gp-bleu-primaire);
}

.recap-card.highlight {
    border-left-color: #059669;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}

.recap-card-label {
    font-size: 12px;
    color: var(--gp-gris);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recap-card-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--gp-bleu-primaire);
}

.recap-card.highlight .recap-card-value {
    color: #059669;
}

.recap-card-sub {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Liste détails */
.detail-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gp-gris-clair);
}

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

.detail-row-label {
    font-size: 13px;
    color: var(--gp-gris);
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-row-value {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.detail-row-value.primary {
    color: var(--gp-bleu-primaire);
}

/* Éléments variables - heures sup, absences */
.elements-variables-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.element-variable-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.element-variable-item label {
    font-size: 12px;
    color: var(--gp-gris);
    font-weight: 500;
}

.element-variable-item input {
    padding: 10px 12px;
    border: 1px solid var(--gp-bordure);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.element-variable-item input:focus {
    outline: none;
    border-color: var(--gp-bleu-primaire);
    box-shadow: 0 0 0 3px rgba(29, 69, 140, 0.1);
}

.element-variable-item input:disabled {
    background: var(--gp-fond-pale);
    color: #9ca3af;
}

/* Section cumuls */
.cumuls-inline {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.cumul-inline-item {
    flex: 1;
    min-width: 150px;
    padding: 12px 16px;
    background: var(--gp-fond-pale);
    border-radius: 8px;
    border: 1px solid var(--gp-bordure);
}

.cumul-inline-item.editable {
    border-color: var(--gp-bleu-primaire);
    background: #f0f7ff;
}

.cumul-inline-label {
    font-size: 11px;
    color: var(--gp-gris);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.cumul-inline-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--gp-bleu-primaire);
}

.cumul-inline-item input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    text-align: right;
    display: none;
}

.cumul-inline-item.editable input {
    display: block;
}

.cumul-inline-item.editable .cumul-inline-value {
    display: none;
}

.btn-modifier-small {
    background: none;
    border: none;
    color: var(--gp-bleu-primaire);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-modifier-small:hover {
    background: var(--gp-pastille);
    text-decoration: underline;
}

/* Congés inline */
.conges-inline-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.conges-inline-item {
    text-align: center;
    padding: 12px;
    background: var(--gp-fond-pale);
    border-radius: 8px;
    border: 1px solid var(--gp-bordure);
}

.conges-inline-label {
    font-size: 10px;
    color: var(--gp-gris);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.conges-inline-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--gp-bleu-primaire);
}

.conges-inline-item.solde {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.conges-inline-item.solde .conges-inline-value {
    color: #16a34a;
}

.conges-inline-item input {
    width: 40px;
    padding: 4px 2px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    background: transparent;
    -moz-appearance: textfield;
}

.conges-inline-item input::-webkit-outer-spin-button,
.conges-inline-item input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.conges-inline-item .input-spinner {
    display: none;
    margin-top: 6px;
}

.conges-inline-item.editable .input-spinner {
    display: flex;
}

.conges-inline-item.editable .conges-inline-value {
    display: none;
}

/* Info badge */
.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #ecfdf5;
    border-radius: 6px;
    font-size: 12px;
    color: #059669;
    margin-top: 12px;
}

.info-badge.warning {
    background: #fef3c7;
    color: #d97706;
}

.info-badge svg {
    width: 14px;
    height: 14px;
}

/* Heures supplémentaires */
.heures-sup-section {
    background: #fefce8;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.heures-sup-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.heures-sup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fefce8;
    border-radius: 6px;
}

.heures-sup-item label {
    font-size: 13px;
    color: var(--gp-jaune-texte);
}

.heures-sup-item input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid var(--gp-jaune-vif);
    border-radius: 4px;
    font-size: 13px;
    text-align: right;
}

/* Absences section */
.absences-section {
    background: #fef2f2;
    border-radius: 8px;
    padding: 16px;
}

.absences-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.absence-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fef2f2;
    border-radius: 6px;
}

.absence-item label {
    font-size: 13px;
    color: #991b1b;
    flex: 1 1 auto;
    margin-right: 8px;
}

/* Lot 29 (fiche 23, R2-20) : nature d'absence du mois, liste déroulante à côté de son libellé */
.absence-item select {
    flex: 0 1 55%;
    max-width: 55%;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 13px;
    color: #991b1b;
    background: #fff;
}

.absence-item input {
    width: 50px;
    padding: 6px 4px;
    border: none;
    border-radius: 0;
    font-size: 13px;
    text-align: center;
    background: transparent;
    -moz-appearance: textfield;
}

.absence-item input::-webkit-outer-spin-button,
.absence-item input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Input Spinner avec boutons +/- */
.input-spinner {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 6px;
    overflow: visible;
}

.input-spinner.yellow {
    border: 1px solid var(--gp-jaune-vif);
}

.input-spinner.red {
    border: 1px solid #fecaca;
}

.input-spinner.blue {
    border: 1px solid #93c5fd;
}

.input-spinner-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.input-spinner-btn:hover {
    background: rgba(0,0,0,0.05);
}

.input-spinner-btn:active {
    background: rgba(0,0,0,0.1);
    transform: scale(0.95);
}

.input-spinner.yellow .input-spinner-btn {
    color: var(--gp-jaune-texte);
}

.input-spinner.yellow .input-spinner-btn:hover {
    background: #fef9c3;
}

.input-spinner.red .input-spinner-btn {
    color: #991b1b;
}

.input-spinner.red .input-spinner-btn:hover {
    background: #fee2e2;
}

.input-spinner.blue .input-spinner-btn {
    color: #1d4ed8;
}

.input-spinner.blue .input-spinner-btn:hover {
    background: #dbeafe;
}

.input-spinner-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

.input-spinner input {
    width: 45px;
    padding: 4px 2px;
    border: none;
    border-left: 1px solid rgba(0,0,0,0.1);
    border-right: 1px solid rgba(0,0,0,0.1);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    background: transparent;
    -moz-appearance: textfield;
}

.input-spinner input::-webkit-outer-spin-button,
.input-spinner input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-spinner input:focus {
    outline: none;
    background: rgba(0,0,0,0.02);
}

/* Heures sup - ajuster pour spinner */
.heures-sup-item input {
    width: 45px;
    padding: 4px 2px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    background: transparent;
    -moz-appearance: textfield;
}

.heures-sup-item input::-webkit-outer-spin-button,
.heures-sup-item input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Legacy support pour cumuls et conges */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    margin: 0;
    font-size: 16px;
    color: #374151;
}

.btn-modifier-cumuls,
.btn-modifier-conges {
    background: none;
    border: none;
    color: var(--gp-bleu-primaire);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-modifier-cumuls:hover,
.btn-modifier-conges:hover {
    background: var(--gp-pastille);
    text-decoration: underline;
}

.btn-modifier-cumuls.active,
.btn-modifier-conges.active {
    color: #22c55e;
}

.cumul-info,
.conges-info {
    margin-top: 12px;
    padding: 10px;
    background: #ecfdf5;
    border-radius: 8px;
    font-size: 12px;
    color: #059669;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cumul-info.manual,
.conges-info.manual {
    background: #fef3c7;
    color: #d97706;
}

/* Section Primes */
.primes-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    grid-column: 1 / -1;
}
.primes-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.primes-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}
.prime-precarite-container {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
    display: none;
}
.prime-precarite-container.active {
    display: block;
}
.prime-precarite-container .prime-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.prime-precarite-container label {
    font-weight: 600;
    color: #92400e;
    font-size: 14px;
}
.prime-precarite-value {
    font-size: 18px;
    font-weight: 700;
    color: #d97706;
}
.prime-precarite-info {
    font-size: 12px;
    color: #b45309;
}
.fin-contrat-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--gp-gris-clair);
    border-radius: 8px;
}
.fin-contrat-toggle label {
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.fin-contrat-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--gp-success);
}
.primes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.prime-item {
    display: grid;
    grid-template-columns: 1fr 120px 40px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: var(--gp-fond-pale);
    border-radius: 8px;
    border: 1px solid var(--gp-bordure);
}
.prime-item select,
.prime-item input {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}
.prime-item input.prime-montant {
    text-align: right;
}
.btn-remove-prime {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-remove-prime:hover {
    background: #fecaca;
}
.btn-add-prime {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: #ecfdf5;
    color: #059669;
    border: 1px dashed var(--gp-success);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}
.btn-add-prime:hover {
    background: var(--gp-success-pale);
    border-style: solid;
}
.primes-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f0fdf4;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid #bbf7d0;
}
.primes-total-label {
    font-weight: 600;
    color: #166534;
}
.primes-total-value {
    font-size: 18px;
    font-weight: 700;
    color: #15803d;
}
.recap-primes {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gp-bordure);
}
.recap-primes-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: #059669;
}

.recap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 14px;
}

.recap-grid > div {
    padding: 8px 0;
    border-bottom: 1px solid var(--gp-bordure);
}

/* Migré de max-width: 768px vers max-width: 767px - Étape 2 responsive */
@media (max-width: 767px) {
    .step4-layout {
        grid-template-columns: 1fr;
    }

    /* Step 4 - KPIs compact en mobile */
    .step4-header-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .step4-kpis {
        justify-content: space-between;
        gap: var(--space-sm, 0.5rem);
    }

    .step4-kpi {
        flex: 1;
        min-width: 80px;
        padding: 0.4rem var(--space-sm, 0.5rem);
    }

    .step4-kpi-value {
        font-size: 0.8rem;
    }

    .step4-kpi-sub {
        font-size: 0.65rem;
    }

    .recap-summary {
        grid-template-columns: 1fr;
        gap: var(--space-md, 12px);
    }

    .recap-card {
        padding: var(--space-md, 12px);
    }

    .recap-card-value {
        font-size: var(--font-size-base, 16px);
    }

    .heures-sup-grid,
    .absences-grid {
        grid-template-columns: 1fr;
    }

    .conges-inline-grid {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 8px;
    }

    .step4-accordion-content > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .cumuls-inline {
        flex-direction: column;
        gap: 12px;
    }

    .cumul-inline-item {
        min-width: auto;
    }

    .step4-accordion-header {
        padding: 14px 16px;
    }

    .step4-accordion-content {
        padding: 16px;
    }

    /* Ajustements responsifs pour l'alignement des badges */
    .step4-accordion-badge {
        min-width: 80px;      /* Largeur réduite sur mobile */
        font-size: 11px;
        padding: 3px 8px;
    }

    .step4-accordion-title {
        gap: 8px;
        font-size: 13px;
    }
}

/* NAVIGATION */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    padding: 24px 0;
    margin-top: auto;
    border-top: 1px solid var(--gp-bordure);
    position: relative;
    z-index: 1;
}

.btn-wizard {
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-prev {
    background: white;
    color: var(--gp-gris);
    border: 2px solid var(--gp-bordure);
}

.btn-prev:hover {
    background: var(--gp-gris-clair);
    border-color: #d1d5db;
}

.btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-next {
    background: var(--gp-bleu-primaire);
    color: white;
}

.btn-next:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-submit {
    background: var(--gp-success);
    color: white;
    padding: 14px 36px;
}

.btn-submit:hover {
    background: #16a34a;
}

/* Contenu des étapes */
.step-content {
    display: none;
    flex: 1;
}

.step-content.active {
    display: block;
}

/* Lot 99 : le fondu ne joue plus qu'ENTRE deux étapes. La classe fp-etape-fondu
   est posée par goToStep() sur l'étape d'arrivée ; l'étape active du premier
   affichage (écrite dans la page) ne la porte pas : elle apparaît tout de suite,
   sans partir d'une opacité nulle (premier affichage retardé de 0,3 s, audit du
   10/11/2026, § 2.1). */
.step-content.active.fp-etape-fondu {
    animation: fadeIn 0.3s ease;
}

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

/* RESULTATS */
.resultats-section {
    padding: 32px;
    text-align: center;
}

.resultats-section h2 {
    color: var(--gp-bleu-primaire);
    margin-bottom: 24px;
}

.resultats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.resultat-card {
    background: var(--gp-fond-pale);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.resultat-card.highlight {
    background: var(--gp-bleu-primaire);
    color: white;
}

.resultat-label {
    display: block;
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 6px;
}

.resultat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-download {
    background: var(--gp-bleu-primaire);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download:hover {
    background: #163a75;
    transform: translateY(-2px);
}

.info-text {
    color: var(--gp-gris);
    font-size: 13px;
    margin-top: 12px;
}

/* ========================================
   RECHERCHE ENTREPRISE PAR NOM
======================================== */
.entreprise-search-wrapper {
    position: relative;
    width: 100%;
    overflow: visible !important;
}

.entreprise-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--gp-blanc);
    border: 2px solid var(--gp-bleu-primaire);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 99999;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    display: none;
}

.entreprise-dropdown.active {
    display: block;
}

.entreprise-option {
    padding: 14px 18px;
    cursor: pointer !important;
    border-bottom: 1px solid var(--gp-bordure);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s ease;
    background: var(--gp-blanc);
}

.entreprise-option:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.entreprise-option:hover,
.entreprise-option.selected {
    background: linear-gradient(135deg, #e8f4fc 0%, #f0f7ff 100%);
    border-left: 4px solid var(--gp-bleu-primaire);
    padding-left: 14px;
    cursor: pointer !important;
}

.entreprise-option strong {
    color: var(--gp-bleu-primaire);
    font-size: 15px;
    font-weight: 700;
}

.entreprise-option:hover strong {
    color: #0d2d5c;
}

.entreprise-option span {
    font-size: 13px;
    color: var(--gp-gris);
    display: flex;
    align-items: center;
    gap: 6px;
}

.entreprise-option span::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.entreprise-option:hover span {
    color: #4b5563;
}

/* AUTOCOMPLETE CONVENTION */
.autocomplete-wrapper {
    position: relative;
    overflow: visible !important;
}
#convention_search {
    width: 100%;
    box-sizing: border-box;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--gp-bleu-primaire);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 99999;
    display: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.autocomplete-dropdown.active {
    display: block;
}

/* S'assurer que les conteneurs parents permettent le débordement */
.form-group:has(.autocomplete-wrapper) {
    position: relative;
    overflow: visible !important;
}

.form-grid,
.step-content,
.wizard-card {
    overflow: visible !important;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--gp-gris-clair);
    font-size: 14px;
    transition: background 0.15s;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #eff6ff;
}

.autocomplete-item .idcc-num {
    font-weight: 700;
    color: var(--gp-bleu-primaire);
    margin-right: 8px;
}

.autocomplete-item .highlight {
    background: #fef08a;
    font-weight: 600;
}

.autocomplete-no-result {
    padding: 12px 16px;
    color: #9ca3af;
    font-style: italic;
}

/* ========================================
   AUTOCOMPLETE ADRESSE - API GOUV
======================================== */
.adresse-autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.adresse-autocomplete-wrapper input {
    width: 100%;
    box-sizing: border-box;
}

.adresse-autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--gp-bleu-primaire);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 99999;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.adresse-autocomplete-suggestions.show {
    display: block;
}

.adresse-autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.adresse-autocomplete-item:last-child {
    border-bottom: none;
}

.adresse-autocomplete-item:hover {
    background: #f0f4ff;
}

.adresse-autocomplete-item-main {
    color: var(--gp-bleu-primaire);
    font-weight: 500;
    font-size: 14px;
}

.adresse-autocomplete-item-detail {
    color: #888;
    font-size: 12px;
    margin-top: 2px;
}

.adresse-autocomplete-loader {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #e0e5eb;
    border-top-color: var(--gp-bleu-primaire);
    border-radius: 50%;
    animation: adresse-spin 0.8s linear infinite;
    display: none;
}

.adresse-autocomplete-loader.show {
    display: block;
}

@keyframes adresse-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.adresse-autocomplete-no-result {
    padding: 12px 16px;
    color: #9ca3af;
    font-style: italic;
    font-size: 13px;
}

/* RESPONSIVE - Migré de max-width: 900px vers max-width: 991px - Étape 2 responsive */
@media (max-width: 991px) {
    .form-container {
        flex-direction: column;
        margin: var(--space-md, 15px);
        min-height: auto;
    }

    .form-sidebar {
        width: 100%;
        min-width: auto;
        padding: var(--space-lg, 20px);
        border-radius: var(--space-md, 16px) var(--space-md, 16px) 0 0;
    }

    /* Steps en ligne horizontale sur mobile */
    .form-steps {
        display: flex;
        overflow-x: auto;
        gap: var(--space-md, 15px);
        padding-bottom: 10px;
    }

    .form-step {
        flex-direction: column;
        align-items: center;
        padding: 10px var(--space-md, 15px);
        text-align: center;
        min-width: 80px;
        padding-left: 0;
        padding-bottom: 0;
    }

    .form-step::before {
        display: none;
    }

    .step-icon {
        position: relative;
        margin-bottom: 8px;
        left: auto;
    }

    .step-info p,
    .step-status {
        display: none;
    }

    .form-main {
        padding: 25px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .periode-selects {
        flex-direction: column;
    }

    .resultats-grid {
        grid-template-columns: 1fr;
    }

    .step4-layout {
        grid-template-columns: 1fr;
    }
}

/* Lot 32 c (retour smartphone du 20/10/2026) : sur smartphone, les quatre étapes tiennent
   dans la largeur de l'écran (360 px compris) au lieu de défiler : la quatrième
   (« Récapitulatif ») apparaissait coupée. Rien d'ajouté : mêmes pastilles, mêmes titres,
   répartis à parts égales ; le HTML du formulaire est inchangé. */
@media (max-width: 480px) {
    .form-sidebar {
        padding-left: 12px;
        padding-right: 12px;
    }

    .form-steps {
        gap: 4px;
        overflow-x: visible;
        justify-content: space-between;
    }

    .form-step {
        flex: 1 1 0;
        min-width: 0;
        padding-left: 2px;
        padding-right: 2px;
    }

    .form-step .step-info {
        min-width: 0;
        max-width: 100%;
    }

    /* Titres entiers à 360 px et au-delà ; en dessous, le seul « Récapitulatif » se couperait
       au trait d'union (césure française du navigateur, page en lang="fr"), jamais au milieu d'un mot */
    .form-step .step-info h4 {
        font-size: 11px;
        line-height: 1.2;
        overflow-wrap: normal;
        hyphens: auto;
    }

    /* Étape active : même corps que les autres (16 px débordait de sa case à 360 px), l'état actif reste
       marqué par la pastille blanche et l'opacité */
    .form-step.active .step-info h4 {
        font-size: 11px;
    }
}

/* =====================================================
   MODAL CGU
   ===================================================== */
.cgu-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cgu-modal-overlay.hidden {
    display: none;
}

.cgu-modal {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.cgu-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--gp-bordure);
    text-align: center;
}

.cgu-brand-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--gp-bleu-primaire);
    position: relative;
    display: inline-block;
}

.cgu-brand-name sup {
    position: absolute;
    font-size: 0.45em;
    margin-left: 2px;
}

.cgu-modal-body {
    padding: 24px;
    text-align: center;
}

.cgu-maintenance-notice {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    color: #991b1b;
}

.cgu-maintenance-notice svg {
    flex-shrink: 0;
    color: #dc2626;
    margin-top: 2px;
}

.cgu-maintenance-notice strong {
    color: #dc2626;
}

.cgu-maintenance-notice div {
    font-size: 13px;
    line-height: 1.5;
}

.cgu-rgpd-notice {
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 16px 0;
    text-align: left;
}

.cgu-rgpd-notice p {
    margin: 0;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.5;
}

.cgu-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 24px 0;
    padding: 14px 24px;
    background: var(--gp-fond-pale);
    border: 2px solid var(--gp-bleu-primaire);
    border-radius: 10px;
    color: var(--gp-bleu-primaire);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.cgu-link:hover {
    background: var(--gp-bleu-primaire);
    color: white;
}

.cgu-link svg {
    flex-shrink: 0;
}

/* Bouton accepter CGU (remplace checkbox + continuer) */
.btn-accept-cgu {
    width: 100%;
    padding: 14px 20px;
    background: var(--gp-bleu-primaire);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 24px 0 16px 0;
    transition: all 0.2s;
}

.btn-accept-cgu:hover {
    background: #163a75;
    transform: translateY(-1px);
}

.btn-accept-cgu svg {
    flex-shrink: 0;
}

.cgu-modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    justify-content: center;
}

.btn-cgu-cancel {
    padding: 12px 32px;
    border: 2px solid var(--gp-bordure);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--gp-gris);
    transition: all 0.2s;
}

.btn-cgu-cancel:hover {
    background: var(--gp-gris-clair);
    border-color: #d1d5db;
}

/* =====================================================
   MODAL EMAIL STRIPE - CENTREE
   ===================================================== */
.email-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}

.email-modal-overlay.visible {
    display: flex;
}

.email-modal {
    background: white;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.email-modal-header {
    padding: 24px 24px 0 24px;
    text-align: center;
}

.email-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--gp-bleu-primaire);
    font-weight: 700;
}

.email-modal-header p {
    margin: 8px 0 0 0;
    color: var(--gp-gris);
    font-size: 14px;
}

.email-modal-body {
    padding: 24px;
}

.email-input-wrapper {
    position: relative;
}

.email-input-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.email-input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    border: 2px solid var(--gp-bordure);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.email-input:focus {
    outline: none;
    border-color: var(--gp-bleu-primaire);
    box-shadow: 0 0 0 3px rgba(29, 69, 140, 0.1);
}

.email-input.error {
    border-color: var(--gp-error);
}

.email-error-msg {
    color: var(--gp-error);
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

.email-error-msg.visible {
    display: block;
}

.email-warning-text {
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    margin-top: 12px;
    line-height: 1.5;
}

.email-modal-footer {
    padding: 0 24px 24px 24px;
    display: flex;
    gap: 12px;
}

.btn-email-cancel {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--gp-bordure);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: var(--gp-gris);
    transition: all 0.2s;
}

.btn-email-cancel:hover {
    background: var(--gp-gris-clair);
    border-color: #d1d5db;
}

.btn-email-submit {
    flex: 2;
    padding: 14px 20px;
    background: var(--gp-bleu-primaire);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-email-submit:hover {
    background: #163a75;
}

.btn-email-submit:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* =====================================================
   EFFECTIF ENTREPRISE - Radio buttons
   ===================================================== */

.effectif-radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.effectif-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--gp-fond-pale);
    border: 2px solid var(--gp-bordure);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 180px;
}

.effectif-option:hover {
    border-color: var(--gp-bleu-primaire);
    background: #f0f4ff;
}

.effectif-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--gp-bleu-primaire);
    cursor: pointer;
}

.effectif-label {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.effectif-option input[type="radio"]:checked + .effectif-label {
    color: var(--gp-bleu-primaire);
    font-weight: 600;
}

.effectif-option:has(input:checked) {
    border-color: var(--gp-bleu-primaire);
    background: #eff6ff;
}

/* =====================================================
   MODE DE PAIEMENT (lot 55) - trois boutons côte à côte
   ===================================================== */

.mode-paiement {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mode-paiement-titre {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.mode-paiement-boutons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.mode-paiement-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 8px;
    background: var(--gp-fond-pale);
    border: 2px solid var(--gp-bordure);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-align: center;
}

.mode-paiement-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.mode-paiement-option:hover {
    border-color: var(--gp-bleu-primaire);
    background: #f0f4ff;
}

.mode-paiement-option:has(input:checked) {
    border-color: var(--gp-bleu-primaire);
    background: #eff6ff;
    color: var(--gp-bleu-primaire);
    font-weight: 600;
}

.mode-paiement-option:has(input:focus-visible) {
    outline: 3px solid var(--gp-bleu-primaire);
    outline-offset: 2px;
}

/* =====================================================
   DURÉE HEBDOMADAIRE - Radio buttons
   ===================================================== */

.duree-hebdo-group {
    margin-bottom: 1.5rem;
}

.duree-hebdo-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.duree-hebdo-radios .radio-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gp-bordure);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--gp-blanc);
}

.duree-hebdo-radios .radio-label:hover {
    border-color: var(--gp-bleu-primaire);
    background: var(--gp-fond-pale);
}

.duree-hebdo-radios .radio-label:has(input:checked) {
    border-color: var(--gp-success);
    background: #ecfdf5;
}

.duree-hebdo-radios .radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gp-success);
    cursor: pointer;
    margin: 0;
}

.duree-hebdo-radios .radio-label span {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.duree-hebdo-radios .radio-label:has(input:checked) span {
    color: #059669;
    font-weight: 600;
}

.duree-hebdo-radios .radio-label small {
    color: var(--gp-gris);
    font-size: 0.75rem;
    margin-left: 2px;
}

.duree-autre-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--gp-bordure);
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.duree-autre-input:focus {
    outline: none;
    border-color: var(--gp-success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Taux horaire avec suffixe €/h */
.taux-horaire-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.taux-horaire-wrapper input {
    padding-right: 50px !important;
    width: 100%;
}

.taux-horaire-suffix {
    position: absolute;
    right: 14px;
    color: var(--gp-success);
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
}

/* Alerte SMIC - Taux horaire inférieur au minimum */
.alerte-smic {
    display: none;
    margin-top: 8px;
    padding: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 13px;
    color: #dc2626;
    font-weight: 500;
}

.alerte-smic::before {
    content: "⚠️ ";
}

/* Input en erreur (taux < SMIC) */
.form-group input.input-error,
.taux-horaire-wrapper input.input-error {
    border-color: #dc2626 !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Responsive mobile - Migré de max-width: 768px vers max-width: 767px - Étape 2 responsive */
@media (max-width: 767px) {
    .duree-hebdo-radios {
        flex-direction: column;
        align-items: stretch;
    }

    .duree-hebdo-radios .radio-label {
        justify-content: flex-start;
        padding: 0.75rem var(--space-md, 1rem);
    }

    .duree-autre-input {
        width: 100%;
        margin-top: var(--space-sm, 0.5rem);
    }
}

/* =====================================================
   NOUVEAUX BLOCS ETAPE 4 - Inputs avec suffixes
   ===================================================== */

.input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-suffix input {
    padding-right: 40px !important;
    width: 100%;
}

.input-with-suffix .input-suffix {
    position: absolute;
    right: 14px;
    color: var(--gp-gris);
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
}

/* Checkbox options dans les nouveaux blocs */
.checkbox-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.checkbox-options .checkbox-inline {
    background: var(--gp-gris-clair);
    padding: 10px 14px;
    border-radius: 8px;
}

/* Sections spécifiques des nouveaux blocs */
.pas-section,
.mutuelle-section,
.transport-section,
.cotisations-section {
    padding-bottom: 12px;
}

/* Badge modifié pour les nouveaux blocs */
.step4-accordion-badge.modified {
    background: #fef3c7 !important;
    color: #92400e !important;
}

/* =====================================================
   APERÇU BULLETIN - FORMAT A4
   ===================================================== */

.preview-container {
    width: 100%;
    overflow: hidden; /* Pas de scroll horizontal - le scaling gère tout */
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--gp-fond-pale);
    border-radius: 8px;
    padding: var(--space-sm, 8px);
    box-sizing: border-box;
}

/* Wrapper A4 pour centrer et scaler le bulletin */
.preview-container .bulletin-a4-wrapper,
.preview-container .preview-wrapper {
    width: 794px; /* Largeur A4 a 96dpi */
    min-width: 794px;
    margin: 0 auto;
    transform-origin: top center;
    transition: transform 0.2s ease;
}

/* Le bulletin lui-meme */
.preview-container > div[style*="max-width:900px"],
.preview-container > div[style*="font-family:Arial"],
.preview-container .bp {
    width: 794px !important;
    max-width: 794px !important;
    min-width: 794px !important;
    margin: 0 auto;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 4px;
    transform-origin: top center;
    transition: transform 0.2s ease;
}

/* ========================================
   SCALING RESPONSIVE - APERCU PDF
   Réactivé le 02/02/2026 - Étape 8 responsive
   Utilise CSS custom property pour le scale dynamique
   ======================================== */

/* Tablette (768px - 991px) : scale ~70% */
@media (max-width: 991px) {
    .preview-container {
        padding: var(--space-sm, 8px);
        /* Hauteur calculée dynamiquement via JS ou fallback CSS */
        --preview-scale: 0.70;
    }

    .preview-container > div[style*="max-width:900px"],
    .preview-container > div[style*="font-family:Arial"],
    .preview-container .bp,
    .preview-container .preview-wrapper {
        transform: scale(var(--preview-scale, 0.70));
        transform-origin: top center;
    }

    /* Ajuster la hauteur du conteneur pour éviter espace vide */
    .preview-container {
        /* Hauteur A4 (1123px) * scale */
        height: calc(1123px * var(--preview-scale, 0.70));
        max-height: calc(1123px * var(--preview-scale, 0.70));
    }
}

/* Mobile (576px - 767px) : scale ~55% */
@media (max-width: 767px) {
    .preview-container {
        --preview-scale: 0.55;
        padding: var(--space-xs, 4px);
        border-radius: 4px;
    }

    .preview-container > div[style*="max-width:900px"],
    .preview-container > div[style*="font-family:Arial"],
    .preview-container .bp,
    .preview-container .preview-wrapper {
        transform: scale(var(--preview-scale, 0.55));
    }

    .preview-container {
        height: calc(1123px * var(--preview-scale, 0.55));
        max-height: calc(1123px * var(--preview-scale, 0.55));
    }
}

/* Petit mobile (< 576px) : scale ~47% */
@media (max-width: 575px) {
    .preview-container {
        --preview-scale: 0.47;
        padding: var(--space-xs, 4px);
    }

    .preview-container > div[style*="max-width:900px"],
    .preview-container > div[style*="font-family:Arial"],
    .preview-container .bp,
    .preview-container .preview-wrapper {
        transform: scale(var(--preview-scale, 0.47));
    }

    .preview-container {
        height: calc(1123px * var(--preview-scale, 0.47));
        max-height: calc(1123px * var(--preview-scale, 0.47));
    }
}

/* Desktop (>= 992px) : taille reelle, pas de scale */
@media (min-width: 992px) {
    .preview-container {
        --preview-scale: 1;
        padding: 20px;
        height: auto;
        max-height: none;
        overflow-x: auto; /* Scroll si necessaire sur desktop */
    }

    .preview-container > div[style*="max-width:900px"],
    .preview-container > div[style*="font-family:Arial"],
    .preview-container .bp,
    .preview-container .preview-wrapper {
        transform: none;
    }
}

/* Lot 30 (A3-02, A3-05) : le conseil de zoom au pincement a disparu avec sa zone ;
   l'aperçu s'agrandit par le bouton « Agrandir » (section « Lot 30 » en fin de feuille). */


/* ===== OAUTH GOOGLE ===== */
.oauth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 16px 0;
    color: var(--gp-gris);
    font-size: 14px;
}

.oauth-separator::before,
.oauth-separator::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--gp-bordure);
}

.oauth-separator span {
    padding: 0 12px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: var(--gp-blanc);
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.btn-google:hover {
    background: var(--gp-fond-pale);
    border-color: #c6c6c6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.btn-google:active {
    background: #f1f3f4;
}

.btn-google svg {
    flex-shrink: 0;
}

/* ===== OAUTH MICROSOFT ===== */
.btn-microsoft {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: var(--gp-blanc);
    border: 1px solid #8c8c8c;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #5e5e5e;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.btn-microsoft:hover {
    background: #f3f3f3;
    border-color: #666666;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.btn-microsoft:active {
    background: #e9e9e9;
}

.btn-microsoft svg {
    flex-shrink: 0;
}

/* ===== OAUTH LINKEDIN ===== */
.btn-linkedin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background-color: #0A66C2;
    color: var(--gp-blanc);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.btn-linkedin:hover {
    background-color: #004182;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.btn-linkedin:active {
    background-color: #003366;
}

.btn-linkedin svg {
    flex-shrink: 0;
}

/* =====================================================
   LOADER STRIPE REDIRECT - Redirection paiement sécurisé
   ===================================================== */
.stripe-redirect-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stripe-redirect-box {
    background: var(--gp-blanc);
    border-radius: 16px;
    padding: 24px 28px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    max-width: 320px;
    width: 90%;
}

.stripe-redirect-box p {
    margin: 0;
    color: var(--gp-bleu-primaire);
    font-size: 15px;
    font-weight: 500;
}

.stripe-redirect-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gp-bordure);
    border-top-color: var(--gp-bleu-primaire);
    border-radius: 50%;
    margin: 0 auto 16px auto;
    animation: stripeSpin 0.8s linear infinite;
}

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

/* ========================================
   APERÇU BULLETIN - VUE COMPACT AVEC SCROLL
   Modifié 30/01/2026 - Hauteur limitée + scroll interne
   Fix 30/01/2026 - Filigrane clippé + marges réduites
   ======================================== */

/* Conteneur de l'aperçu - fond gris clair */
.apercu-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px;              /* Réduit de 24px à 12px */
    background: #e2e8f0;
    border-radius: 8px;
    box-sizing: border-box;
}

/* La "feuille" A4 avec ombre portée et scroll */
.apercu-bulletin {
    width: min(100%, 794px);        /* Largeur A4 (210mm @ 96dpi) */
    max-height: 700px;              /* Hauteur limitée - Vue Compact */
    overflow-y: auto;               /* Scroll interne si contenu dépasse */
    overflow-x: hidden;
    background: var(--gp-blanc);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
}

/* Scrollbar stylée pour .apercu-bulletin */
.apercu-bulletin::-webkit-scrollbar {
    width: 8px;
}

.apercu-bulletin::-webkit-scrollbar-track {
    background: var(--gp-gris-clair);
    border-radius: 0 4px 4px 0;
}

.apercu-bulletin::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.apercu-bulletin::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox scrollbar */
.apercu-bulletin {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 var(--gp-gris-clair);
}

/* Contenu interne - reset des marges et scale */
.apercu-bulletin .bp,
.apercu-bulletin .bulletin,
.apercu-bulletin > div {
    width: 100%;
    height: auto;
    padding: 0;
    margin: 0;
    max-width: none;
    /* transform: none - désactivé pour permettre le scaling mobile */
    transform-origin: top center;
}

/* Clipper le filigrane à l'intérieur du bulletin */
.apercu-bulletin .bp {
    position: relative;             /* Nécessaire pour position:absolute du filigrane */
    overflow: hidden;               /* Clippe le filigrane qui déborde */
}

/* Responsive tablette - Migré de max-width: 900px vers max-width: 991px - Étape 2 responsive */
@media (max-width: 991px) {
    .apercu-container {
        padding: var(--space-sm, 8px);
    }
    .apercu-bulletin {
        max-height: 600px;
    }
}

/* Responsive mobile - Migré de max-width: 650px vers max-width: 767px - Étape 2 responsive */
@media (max-width: 767px) {
    .apercu-container {
        padding: var(--space-sm, 8px);
        border-radius: 0;
    }
    .apercu-bulletin {
        width: 100%;
        max-height: 500px;
        border-radius: 0;
    }
}

/* Reset du padding sur #resultats quand .apercu-container est présent */
/* Note: :has() est supporté dans Chrome 105+, Firefox 121+, Safari 15.4+ */
#resultats:has(.apercu-container) {
    padding: 0 !important;
    margin: 0 !important;
}

/* Fix Phase 2 — Coller sélecteur couleur au bulletin (Codex 18/03/2026) */
#resultats .apercu-container {
    padding-top: 0;
}

/* Boutons d'actions sous l'aperçu */
.apercu-actions {
    text-align: center;
    padding: 16px;              /* Réduit de 24px à 16px */
    background: #e2e8f0;
}

.apercu-actions .btn-modifier {
    background: #6c757d;
    color: white;
    padding: 14px 30px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 15px;
    transition: background 0.2s ease;
}

.apercu-actions .btn-modifier:hover {
    background: #5a6268;
}

.apercu-actions .btn-download-pdf {
    background: linear-gradient(135deg, var(--gp-bleu-primaire), #2d5aa0);
    color: white;
    padding: 18px 40px;
    font-size: 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(29, 69, 140, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.apercu-actions .btn-download-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 69, 140, 0.4);
}

.apercu-actions .info-paiement {
    color: #666;
    font-size: 12px;
    margin-top: 12px;
}

/* FIX MARGE HAUTE - Override du padding inline */
#resultats {
    padding: 0 !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* =====================================================
   BOUTON TAUX MANUELS (Roue crantée)
   ===================================================== */
.btn-taux-manuels {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 18px;
    background: var(--gp-fond-pale);
    color: #475569;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 12px;
}

.btn-taux-manuels:hover {
    background: var(--gp-gris-clair);
    border-color: #94a3b8;
    color: #1e293b;
}

.btn-taux-manuels svg {
    transition: transform 0.3s ease;
}

.btn-taux-manuels:hover svg {
    transform: rotate(45deg);
}

.btn-taux-manuels.taux-actifs {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.btn-taux-manuels.taux-actifs::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    flex-shrink: 0;
}

/* =====================================================
   MODAL TAUX MANUELS - Overlay et Container
   ===================================================== */
.modal-taux-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-taux-content {
    background: var(--gp-blanc);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalTauxSlideIn 0.3s ease;
}

@keyframes modalTauxSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== HEADER ===== */
.modal-taux-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--gp-bleu-primaire) 0%, #152d5c 100%);
    color: white;
}

.modal-taux-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gp-blanc);
}

.modal-taux-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ===== BODY ===== */
.modal-taux-body {
    padding: 0;
    max-height: 55vh;
    overflow-y: auto;
}

/* Scrollbar stylée */
.modal-taux-body::-webkit-scrollbar {
    width: 8px;
}

.modal-taux-body::-webkit-scrollbar-track {
    background: var(--gp-gris-clair);
}

.modal-taux-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.modal-taux-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== TABLE ===== */
.taux-table {
    width: 100%;
    border-collapse: collapse;
}

.taux-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.taux-table th {
    background: var(--gp-fond-pale);
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.taux-table th:nth-child(2),
.taux-table th:nth-child(3) {
    text-align: center;
    width: 120px;
}

.taux-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: #334155;
    border-bottom: 1px solid var(--gp-gris-clair);
}

.taux-table td:nth-child(2),
.taux-table td:nth-child(3) {
    text-align: center;
}

/* Section header dans le tableau */
.taux-section-header td {
    background: #e2e8f0;
    font-weight: 600;
    font-size: 12px;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 16px;
}

/* Inputs des taux */
.taux-input {
    width: 70px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    transition: all 0.2s ease;
    background: var(--gp-blanc);
}

.taux-input:focus {
    outline: none;
    border-color: var(--gp-bleu-primaire);
    box-shadow: 0 0 0 3px rgba(29, 69, 140, 0.1);
}

.taux-input.taux-disabled {
    background: var(--gp-fond-pale);
    color: #94a3b8;
    cursor: not-allowed;
}

.taux-input.taux-modified {
    background: #fef9c3 !important;
    border-color: #fbbf24 !important;
}

/* ===== FOOTER ===== */
.modal-taux-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--gp-fond-pale);
    border-top: 1px solid #e2e8f0;
}

.modal-taux-footer-right {
    display: flex;
    gap: 12px;
}

.btn-taux-reinit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--gp-blanc);
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-taux-reinit:hover {
    background: var(--gp-gris-clair);
    border-color: #cbd5e1;
    color: #475569;
}

.btn-taux-annuler {
    padding: 10px 20px;
    background: var(--gp-blanc);
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-taux-annuler:hover {
    background: var(--gp-gris-clair);
    border-color: #cbd5e1;
}

.btn-taux-appliquer {
    padding: 10px 24px;
    background: var(--gp-success);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-taux-appliquer:hover {
    background: #059669;
}

/* ===== RESPONSIVE - Migré de max-width: 768px vers max-width: 767px - Étape 2 responsive ===== */
@media (max-width: 767px) {
    .modal-taux-content {
        max-width: 100%;
        margin: 10px;
        max-height: 95vh;
    }

    .modal-taux-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .modal-taux-body {
        max-height: 60vh;
    }

    .taux-table th,
    .taux-table td {
        padding: 10px var(--space-sm, 8px);
        font-size: var(--font-size-xs, 12px);
    }

    .taux-table th:nth-child(2),
    .taux-table th:nth-child(3) {
        width: 80px;
    }

    .taux-input {
        width: 55px;
        padding: 6px 4px;
        font-size: var(--font-size-xs, 12px);
    }

    .modal-taux-footer {
        flex-direction: column;
        gap: var(--space-md, 12px);
    }

    .modal-taux-footer-right {
        width: 100%;
        justify-content: stretch;
    }

    .btn-taux-annuler,
    .btn-taux-appliquer {
        flex: 1;
    }

    .btn-taux-manuels {
        padding: 10px 14px;
        font-size: var(--font-size-sm, 13px);
    }

    .btn-taux-manuels span {
        display: none;
    }
}

/* =====================================================
   CLASSES UTILITAIRES RESPONSIVE - Étape 2
   Remplacent les inline styles dans generate.php
   ===================================================== */

/* Grille 2 colonnes responsive */
.form-grid-2cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg, 20px);
}

@media (min-width: 768px) {
    .form-grid-2cols {
        grid-template-columns: 1fr 1fr;
    }
}

/* Grille 3 colonnes responsive */
.form-grid-3cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg, 20px);
}

@media (min-width: 768px) {
    .form-grid-3cols {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Flex avec alignement fin de ligne */
.form-flex-end {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--space-md, 16px);
}

/* Flex entre éléments (space-between) */
.form-flex-between {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm, 14px);
}

@media (max-width: 767px) {
    .form-flex-between {
        flex-direction: column;
        gap: var(--space-sm, 8px);
    }
}

/* Titre de section dans les formulaires */
.form-section-title {
    font-weight: 600;
    font-size: var(--font-size-sm, 13px);
    color: #374151;
    margin-bottom: var(--space-md, 12px);
}

/* Max-width pour petits champs */
.form-field-small {
    max-width: 200px;
}

@media (max-width: 767px) {
    .form-field-small {
        max-width: 100%;
    }
}

/* Récapitulatif tickets restaurant */
.form-recap-box {
    margin-top: var(--space-md, 16px);
    padding: var(--space-md, 12px) var(--space-md, 16px);
    background: #f0f9ff;
    border-radius: var(--space-sm, 8px);
    border: 1px solid #bae6fd;
}

/* Zone congés grille */
.conges-grid-3cols {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 767px) {
    .conges-grid-3cols {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   ENCADRÉ D'INFORMATION EN HAUT DE PAGE (16/10/2026)
   Titre visible (H1) + accroche + trois repères de l'offre.
   Compact : ne repousse pas le formulaire sous la ligne de flottaison.
   ===================================================== */
.fp-intro {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 16px 24px;
    background: white;
    border: 1px solid var(--border);
    border-left: 4px solid var(--gp-bleu-primaire, var(--primary));
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.fp-intro + .form-container {
    margin-top: 16px;
}

.fp-intro__titre {
    font-size: 1.5rem;
    line-height: 1.25;
    color: var(--gp-bleu-primaire, var(--primary));
    margin: 0 0 4px 0;
    font-weight: 700;
}

.fp-intro__accroche {
    font-size: 15px;
    line-height: 1.4;
    color: var(--gray);
    margin: 0 0 10px 0;
}

.fp-intro__reperes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.fp-intro__repere {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--primary-dark);
}

.fp-intro__icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: #059669;
}

@media (max-width: 991px) {
    .fp-intro {
        margin: var(--space-md, 15px) var(--space-md, 15px) 0;
        padding: 12px 14px;
    }

    .fp-intro + .form-container {
        margin-top: 12px;
    }
}

@media (max-width: 767px) {
    .fp-intro__titre {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .fp-intro__accroche {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .fp-intro__reperes {
        gap: 4px 14px;
    }

    .fp-intro__repere {
        font-size: 12px;
        gap: 5px;
    }

    .fp-intro__icon {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 575px) {
    .fp-intro {
        padding: 10px 12px;
    }

    .fp-intro__titre {
        font-size: 1.1rem;
    }

    .fp-intro__reperes {
        flex-direction: column;
        gap: 3px;
    }

    .fp-intro__repere {
        font-size: 11.5px;
    }
}

@media (max-width: 400px) {
    .fp-intro__repere {
        font-size: 11px;
    }
}

/* =====================================================
   LOT 16 — APERÇU DU MODÈLE RÉNOVÉ ET CHOIX DU MODÈLE
   Pages A4 du serveur (une par modèle), mises à l'échelle de la zone ;
   glissement (défilement accroché), flèches et points, comme la maquette
   « Aperçu smartphone » du 17/10/2026. Aucun texte affiché.
   LOT 24 b — aperçu servi en image (maquette validée du 17/10/2026,
   maquette-lot24b) : feuille A4 seule, posée sur le fond de la page (ombre
   douce, angles de 4 px), plus de cadre gris-bleu autour ; image des
   montants en clair superposée et révélée par un masque animé ; boutons
   ronds « précédent / suivant » à mi-hauteur de la feuille, au dégradé du
   blob de la page d'accueil (jetons --gp-orange-clair → --gp-orange).
   ===================================================== */
#resultats .apercu-container.fp-apercu-modeles,
.apercu-container.fp-apercu-modeles {
    display: block;
    padding: 16px 0 0;
    background: transparent;
    border-radius: 0;
}

.fp-apercu-modeles + .apercu-actions {
    background: transparent;
}

.fp-modeles {
    width: 100%;
    max-width: 934px;
    margin: 0 auto;
    padding: 0 70px;
    box-sizing: border-box;
}

.fp-modeles-scene {
    position: relative;
}

.fp-modeles-piste {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    outline: none;
    /* Lot 25 : 27 diapositives ; la largeur de la piste ne dépend jamais de
       leur nombre (sinon leurs marges s'additionnent et élargissent la colonne) */
    contain: inline-size;
}

.fp-modeles-piste::-webkit-scrollbar {
    display: none;
}

.fp-modeles-piste:focus-visible {
    box-shadow: 0 0 0 3px rgba(29, 69, 140, 0.35);
    border-radius: 6px;
}

.fp-modeles-diapo {
    flex: 0 0 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    box-sizing: border-box;
    /* marges qui contiennent toute l'ombre de la feuille (la piste coupe ce qui dépasse) */
    padding: 6px 24px 36px;
}

.fp-modeles-feuille {
    position: relative;
    width: 100%;
    aspect-ratio: 794 / 1123;
    overflow: hidden;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(20, 32, 60, 0.10), 0 10px 24px rgba(20, 32, 60, 0.15);
}

.fp-modeles-image,
.fp-modeles-montants {
    position: absolute;
    display: block;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

.fp-modeles-image {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.fp-modeles-montants {
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    will-change: mask-image;
}

/* Lot 55 : aperçu PAGE PAR PAGE d'un bulletin de plusieurs pages (rendu 4,
   maquette du 28/10/2026). Bureau : vignettes des pages à gauche de la
   feuille ; sous la feuille, navigation « Page 1 sur 2 » (boutons de 44 px)
   et phrase « Votre bulletin fait 2 pages… ». Smartphone : page à la
   largeur de l'écran, navigation pleine largeur sous la page, sans
   vignettes. Une seule page : aucune de ces commandes. */
.fp-modeles-diapo.fp-diapo-pages {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: 14px;
    align-content: start;
}

.fp-diapo-pages .fp-pages-vignettes {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fp-diapo-pages .fp-modeles-feuille,
.fp-diapo-pages .fp-pages-navigation,
.fp-diapo-pages .fp-pages-phrase {
    grid-column: 2;
}

.fp-pages-vignette {
    display: block;
    width: 64px;
    min-height: 44px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(20, 32, 60, 0.18);
    cursor: pointer;
    overflow: hidden;
}

.fp-pages-vignette img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.fp-pages-vignette[aria-current="page"] {
    border-color: var(--gp-orange, #f7931e);
}

.fp-pages-vignette:focus-visible,
.fp-pages-bouton:focus-visible {
    outline: 3px solid rgba(29, 69, 140, 0.55);
    outline-offset: 2px;
}

.fp-pages-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 14px;
}

.fp-pages-bouton {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gp-orange-clair, #fbb03b) 0%, var(--gp-orange, #f7931e) 100%);
    color: #1d2a44;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(247, 147, 30, 0.35);
}

.fp-pages-bouton svg {
    width: 20px;
    height: 20px;
}

.fp-pages-bouton:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    box-shadow: none;
    cursor: default;
}

.fp-pages-numero {
    min-width: 96px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #1d2a44;
}

.fp-pages-phrase {
    margin: 8px 0 0;
    text-align: center;
    font-size: 14px;
    color: #475569;
}

@media (max-width: 767px) {
    .fp-modeles-diapo.fp-diapo-pages {
        grid-template-columns: minmax(0, 1fr);
    }

    .fp-diapo-pages .fp-pages-vignettes {
        display: none;
    }

    .fp-diapo-pages .fp-modeles-feuille,
    .fp-diapo-pages .fp-pages-navigation,
    .fp-diapo-pages .fp-pages-phrase {
        grid-column: 1;
    }

    .fp-pages-navigation {
        justify-content: space-between;
        width: 100%;
    }
}

/* Lot 27 : indicateur de chargement (maquette validée du 17/10/2026). Zone
   d'attente posée sur la feuille ou la case de la miniature, sans en changer
   la taille ; invisible les 300 premières millisecondes (classe
   fp-attente-visible posée par generate.js), puis silhouette très pâle et
   spinner orange au centre ; fondu de sortie à l'image chargée. CSS pur :
   aucune image, aucune bibliothèque. */
.fp-attente {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
}

.fp-attente.fp-attente-visible {
    opacity: 1;
}

.fp-attente.fp-attente-visible.fp-attente-fin {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

/* Silhouette d'un bulletin : titre, lignes, bloc */
.fp-attente-silhouette {
    position: absolute;
    inset: 7%;
    overflow: hidden;
    opacity: 0.55;
}

.fp-attente-silhouette i {
    display: block;
    height: 7px;
    margin-bottom: 9px;
    border-radius: 3px;
    background: #edf0f5;
}

.fp-attente-silhouette i.fp-attente-t {
    width: 45%;
    height: 14px;
    margin-bottom: 16px;
    background: #e4e9f1;
}

.fp-attente-silhouette i.fp-attente-c {
    height: 42px;
    margin: 14px 0 18px;
    border-radius: 6px;
}

.fp-attente-silhouette i.fp-attente-l40 { width: 40%; }
.fp-attente-silhouette i.fp-attente-l55 { width: 55%; }
.fp-attente-silhouette i.fp-attente-l60 { width: 60%; }
.fp-attente-silhouette i.fp-attente-l70 { width: 70%; }
.fp-attente-silhouette i.fp-attente-l80 { width: 80%; }
.fp-attente-silhouette i.fp-attente-l85 { width: 85%; }

/* Spinner : anneau en dégradé des boutons ronds (jetons du blob), 46 px, un tour en 0,8 s */
.fp-attente-spinner {
    position: relative;
    display: block;
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(247, 147, 30, 0) 0deg, var(--gp-orange-clair, #fbb03b) 120deg, var(--gp-orange, #f7931e) 330deg, var(--gp-orange, #f7931e) 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}

.fp-attente-visible .fp-attente-spinner {
    animation: fp-attente-tourne 0.8s linear infinite;
}

/* Miniature du catalogue : 26 px */
.fp-attente-spinner.fp-attente-spinner-petit {
    width: 26px;
    height: 26px;
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
}

@keyframes fp-attente-tourne {
    to { transform: rotate(360deg); }
}

/* Réduire les animations : rotation ralentie, jamais supprimée */
@media (prefers-reduced-motion: reduce) {
    .fp-attente-visible .fp-attente-spinner {
        animation-duration: 2.4s;
    }
}

/* Smartphone : silhouette plus courte (maquette validée) */
@media (max-width: 600px) {
    .fp-attente-silhouette i:nth-child(n+14) {
        display: none;
    }
}

/* Repli (image impossible sur le serveur) : page aux montants neutralisés */
.fp-modeles-cadre {
    position: absolute;
    top: 0;
    left: 0;
    width: 794px;
    height: 1123px;
    border: 0;
    transform-origin: 0 0;
    pointer-events: none;
    background: #ffffff;
}

/* Boutons « modèle précédent / suivant » : ronds, à mi-hauteur de la feuille,
   à l'extérieur de chaque côté (bureau) */
.fp-modeles-fleche {
    position: absolute;
    z-index: 3;
    /* mi-hauteur de la feuille : marges de la diapositive (6 px en haut, 36 px en bas) déduites */
    top: calc(50% - 15px);
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gp-orange-clair, #fbb03b) 0%, var(--gp-orange, #f7931e) 100%);
    color: #1d2a44;
    box-shadow: 0 4px 14px rgba(247, 147, 30, 0.40);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fp-modeles-fleche:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 18px rgba(247, 147, 30, 0.55);
}

.fp-modeles-fleche svg {
    width: 24px;
    height: 24px;
}

.fp-modeles-precedent {
    left: -46px; /* 18 px entre le bouton et la feuille (marge de la diapositive : 24 px) */
}

.fp-modeles-suivant {
    right: -46px;
}

/* Incitation : léger mouvement du bouton « suivant » vers la droite, toutes
   les 2,6 s, tant que le client n'a jamais changé de modèle */
.fp-modeles-suivant.fp-invite {
    animation: fp-invite 2.6s ease-in-out infinite;
}

/* Lot 24 c : titre et sous-titre centrés au-dessus de la feuille */
.fp-apercu-entete {
    text-align: center;
    padding: 0 16px 14px;
}

.fp-apercu-titre {
    margin: 0;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--gp-bleu-marine, #1e3760);
}

.fp-apercu-sous-titre {
    margin: 4px 0 0;
    font-size: 15px;
    line-height: 1.4;
    color: var(--gp-gris, #6b7280);
}

/* Lot 25 : le sous-titre de l’aperçu (libellé apercu_sous_titre) est le bouton qui ouvre
   le catalogue des modèles : pilule à contour bleu marine, fond blanc, fond
   bleu très pâle au survol, pictogramme de grille (SVG) à gauche ; même
   texte, même taille, même couleur que le sous-titre du lot 24 c */
.fp-catalogue-ouvrir {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 16px 6px 13px;
    font-family: inherit;
    font-weight: 500;
    background: #ffffff;
    border: 1.5px solid var(--gp-bleu-marine, #1e3760);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.fp-catalogue-ouvrir svg {
    flex: none;
    color: var(--gp-bleu-marine, #1e3760);
}

.fp-catalogue-ouvrir:hover {
    background: var(--gp-pastille, #e8f0fe);
}

/* Lot 27 : même pastille, inactive, tant que la liste des modèles n'est pas arrivée */
.fp-catalogue-ouvrir:disabled,
.fp-catalogue-ouvrir:disabled:hover {
    background: #ffffff;
    cursor: default;
}

.fp-catalogue-ouvrir:focus-visible {
    outline: 2px solid #1d458c;
    outline-offset: 2px;
}

/* Lot 24 c — ordinateur (colonne de droite de PaieOne : 900 px, marges de
   50 px) : l'aperçu prend 38 px de chaque marge (le formulaire n'est pas
   touché), la feuille occupe la colonne (900 − 2 × 12 − 2 × 44 − 2 × 24 =
   740 px), les boutons restent dans la marge de 44 px, à 12 px de la feuille,
   entièrement visibles ; la feuille suit la largeur de la colonne. */
@media (min-width: 992px) {
    #resultats .apercu-container.fp-apercu-modeles,
    .apercu-container.fp-apercu-modeles {
        margin-left: -38px;
        margin-right: -38px;
    }

    .fp-modeles {
        max-width: none;
        padding: 0 44px;
    }

    .fp-modeles-precedent {
        left: -40px;
    }

    .fp-modeles-suivant {
        right: -40px;
    }
}

@keyframes fp-invite {
    0%, 70%, 100% { transform: translateY(-50%) translateX(0); }
    80% { transform: translateY(-50%) translateX(6px); }
    90% { transform: translateY(-50%) translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .fp-modeles-suivant.fp-invite {
        animation: none;
    }

    .fp-modeles-montants {
        display: none;
    }
}

.fp-modeles-commandes {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px 4px;
}

.fp-modeles-fleche:focus-visible,
.fp-modeles-point:focus-visible {
    outline: 2px solid #1d458c;
    outline-offset: 2px;
}

/* Lot 25 : fenêtre de 7 points (7 × 44 px) quel que soit le nombre de
   modèles : la rangée des points n'élargit jamais la colonne de l'aperçu */
.fp-modeles-points {
    display: flex;
    width: 308px;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* Lot 25 : fenêtre glissante des points (7 visibles, 27 modèles) */
.fp-modeles-points-piste {
    display: flex;
    flex: none;
    transition: transform 0.25s ease;
}

/* Point du bord de la fenêtre quand d'autres modèles suivent : plus petit
   (sélecteur plus précis que « .fp-modeles-point span », déclaré plus bas) */
.fp-modeles-point.fp-modeles-point-bord span {
    width: 5px;
    height: 5px;
}

@media (prefers-reduced-motion: reduce) {
    .fp-modeles-points-piste {
        transition: none;
    }
}

.fp-modeles-point {
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.fp-modeles-point span {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: #c9d3e6;
    transition: width 0.2s ease, background 0.2s ease;
}

.fp-modeles-point[aria-current="true"] span {
    width: 22px;
    background: #1d458c;
}

/* Écran étroit : boutons de 44 px qui mordent légèrement sur les bords de la
   feuille, aucune marge latérale réservée */
@media (max-width: 600px) {
    .fp-modeles {
        padding: 0;
    }

    .fp-modeles-fleche {
        top: calc(50% - 15px);
        width: 44px;
        height: 44px;
    }

    .fp-modeles-fleche svg {
        width: 22px;
        height: 22px;
    }

    .fp-modeles-precedent {
        left: 10px;
    }

    .fp-modeles-suivant {
        right: 10px;
    }

    .fp-modeles-diapo {
        padding: 4px 20px 34px;
    }

    .fp-apercu-titre {
        font-size: 18px;
    }

    .fp-apercu-sous-titre {
        font-size: 14px;
    }
}

/* Smartphone (écran tactile étroit) : page à la largeur de l'écran, 20 px de
   marge de chaque côté, comme la maquette « Aperçu smartphone » (390 px :
   page de 350 px). Les barres de défilement des écrans tactiles ne prennent
   aucune place : 100vw est la largeur visible. */
@media (max-width: 600px) and (pointer: coarse) {
    .fp-modeles {
        width: 100vw;
        max-width: none;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }
}

/* ------------------------------------------------------------------------
   Lot 25 : fenêtre « Catalogue des modèles » (ouverte par le sous-titre de
   l'aperçu) : 7 familles, deux par ligne sur ordinateur, cartes des modèles
   (miniature, code, nom), modèle affiché entouré du dégradé orange du blob ;
   smartphone : plein écran, une famille par ligne, deux cartes par ligne.
   ------------------------------------------------------------------------ */
html.fp-catalogue-ouvert {
    overflow: hidden;
}

.fp-catalogue {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.fp-catalogue[hidden] {
    display: none;
}

.fp-catalogue-fond {
    position: absolute;
    inset: 0;
    background: rgba(20, 32, 60, 0.55);
}

.fp-catalogue-fenetre {
    position: relative;
    width: 100%;
    max-width: 1080px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(20, 32, 60, 0.35);
    overflow: hidden;
}

.fp-catalogue-fenetre:focus {
    outline: none;
}

.fp-catalogue-entete {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 14px;
    border-bottom: 1px solid var(--gp-bordure, #e5e7eb);
}

.fp-catalogue-titre {
    margin: 0;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--gp-bleu-marine, #1e3760);
}

.fp-catalogue-sous-titre {
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--gp-gris, #6b7280);
}

.fp-catalogue-fermer {
    flex: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--gp-gris-clair, #f3f4f6);
    color: var(--gp-bleu-marine, #1e3760);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.fp-catalogue-fermer:hover {
    background: var(--gp-pastille, #e8f0fe);
}

.fp-catalogue-corps {
    overflow-y: auto;
    padding: 18px 24px 26px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 28px;
    align-items: start;
}

.fp-catalogue-famille-nom {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--gp-bleu-marine, #1e3760);
}

.fp-catalogue-cartes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.fp-catalogue-carte {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 6px 6px 8px;
    font-family: inherit;
    text-align: left;
    background: #ffffff;
    border: 2px solid var(--gp-bordure, #e5e7eb);
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.fp-catalogue-carte:hover {
    transform: translateY(-2px);
    border-color: var(--gp-bleu-primaire, #1d458c);
    box-shadow: 0 6px 16px rgba(20, 32, 60, 0.12);
}

.fp-catalogue-carte:focus-visible {
    outline: 2px solid #1d458c;
    outline-offset: 2px;
}

/* Modèle affiché : entouré du dégradé orange du blob */
.fp-catalogue-carte-active,
.fp-catalogue-carte-active:hover {
    border-color: transparent;
    background: linear-gradient(#ffffff, #ffffff) padding-box, linear-gradient(135deg, var(--gp-orange-clair, #fbb03b), var(--gp-orange, #f7931e)) border-box;
}

.fp-catalogue-vignette {
    position: relative;
    display: block;
    aspect-ratio: 794 / 1123;
    margin-bottom: 4px;
    border-radius: 3px;
    background: var(--gp-gris-clair, #f3f4f6);
    box-shadow: 0 1px 3px rgba(20, 32, 60, 0.12);
    overflow: hidden;
}

.fp-catalogue-vignette img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fp-catalogue-vignette img:not([src]) {
    visibility: hidden;
}

/* Lot 27 : miniature en attente : petit spinner centré dans la case grise
   (à la place de la pulsation du lot 25) */
.fp-catalogue-vignette > .fp-attente {
    background: transparent;
}

/* Zone d'attente du catalogue (role="status") : nom lu seulement, rien d'affiché */
.fp-catalogue-statut {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.fp-catalogue-code {
    font-size: 11px;
    line-height: 1.3;
    color: var(--gp-gris, #6b7280);
}

.fp-catalogue-nom {
    font-size: 12.5px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--gp-bleu-marine, #1e3760);
}

@media (max-width: 600px) {
    .fp-catalogue {
        padding: 0;
    }

    .fp-catalogue-fenetre {
        max-width: none;
        max-height: none;
        height: 100%;
        border-radius: 0;
    }

    .fp-catalogue-entete {
        padding: 16px 16px 12px;
    }

    .fp-catalogue-titre {
        font-size: 19px;
    }

    .fp-catalogue-corps {
        grid-template-columns: minmax(0, 1fr);
        padding: 14px 16px 24px;
    }

    .fp-catalogue-cartes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .fp-catalogue-carte,
    .fp-catalogue-carte:hover {
        transition: none;
        transform: none;
    }
}

/* ============================================================================
   LOT 30 (18/10/2026) — audits 26 et 27 : saisie conservée, écran « Modifier »,
   aperçu agrandi, champs de 16 px sur smartphone, accessibilité.
   Section placée en fin de feuille : ses règles l'emportent par l'ordre sur
   celles de 13, 14 et 15 px du formulaire. Aucune valeur de prix ni de
   paiement ici.
   ============================================================================ */

/* ---- Bandeaux non bloquants de la fiche 26 (#fp-bandeaux : saisie retrouvée,
   session expirée, stockage indisponible, connexion) ---------------------- */
#fp-bandeaux:empty {
    display: none;
}

.fp-bandeau {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1.5px solid var(--gp-bordure);
    border-left: 4px solid var(--gp-bleu-primaire);
    border-radius: 10px;
    background: var(--gp-fond-pale);
    color: #1d2a44;
    font-size: 14px;
    line-height: 1.45;
}

.fp-bandeau[data-bandeau="session"] {
    border-left-color: var(--gp-orange);
    background: #fff8ee;
}

.fp-bandeau[data-bandeau="stockage"],
.fp-bandeau[data-bandeau="connexion"] {
    border-left-color: #b45309;
    background: #fffbeb;
}

.fp-bandeau svg {
    flex: none;
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fp-bandeau-texte {
    flex: 1 1 240px;
    min-width: 0;
}

.fp-bandeau-texte p {
    margin: 0;
}

.fp-bandeau-texte p + p {
    margin-top: 4px;
    color: var(--gp-gris);
    font-size: 13px;
}

.fp-bandeau-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.fp-bandeau-bouton {
    /* Cible tactile de 44 px sur tout écran (A6-15) : la hauteur du bandeau ne dépend
       pas du type de pointeur, la mise en page au-dessus du formulaire reste stable */
    min-height: var(--touch-target-min, 44px);
    padding: 7px 14px;
    border: 1.5px solid var(--gp-bleu-primaire);
    border-radius: 10px;
    background: var(--gp-bleu-primaire);
    color: #fff;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}

.fp-bandeau-bouton.fp-bandeau-secondaire {
    background: #fff;
    color: var(--gp-bleu-primaire);
}

.fp-bandeau-fermer {
    width: var(--touch-target-min, 44px);
    height: var(--touch-target-min, 44px);
    margin-left: auto;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--gp-gris);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fp-bandeau-fermer:hover {
    background: rgba(29, 69, 140, 0.08);
}

.fp-bandeau-bouton:focus-visible,
.fp-bandeau-fermer:focus-visible {
    outline: 2px solid var(--gp-bleu-primaire);
    outline-offset: 2px;
}

/* ---- Écran « Modifier » un mois du panier (S2-14, maquette validée) ------- */
.fp-modif-bandeau {
    position: sticky;
    top: var(--fp-modif-top, 0px);
    z-index: var(--z-sticky, 200);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "ligne retour"
        "puces puces";
    gap: 9px 10px;
    align-items: center;
    margin: -40px -50px 18px;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid var(--gp-bordure);
    box-shadow: 0 2px 8px rgba(20, 32, 60, 0.06);
}

.fp-modif-bandeau[hidden] {
    display: none;
}

.fp-modif-bandeau:focus {
    outline: none;
}

.fp-modif-ligne {
    grid-area: ligne;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.fp-modif-pdf {
    width: 26px;
    height: 33px;
    flex: none;
}

.fp-modif-texte {
    flex: 1;
    min-width: 0;
}

.fp-modif-texte b {
    display: block;
    font-size: 15.5px;
    color: #1d2a44;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-modif-texte span {
    display: block;
    font-size: 12.5px;
    color: var(--gp-gris);
}

.fp-modif-texte span:empty {
    display: none;
}

.fp-modif-retour {
    grid-area: retour;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: none;
    white-space: nowrap;
    padding: 7px 10px;
    border: 1.5px solid var(--gp-bleu-primaire);
    border-radius: 10px;
    background: #fff;
    color: var(--gp-bleu-primaire);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.fp-modif-retour svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.4;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fp-modif-retour-long {
    display: none;
}

@media (min-width: 768px) {
    .fp-modif-retour-court {
        display: none;
    }

    .fp-modif-retour-long {
        display: inline;
    }
}

.fp-modif-puces {
    grid-area: puces;
    display: flex;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.fp-modif-puces::-webkit-scrollbar {
    display: none;
}

.fp-modif-puce {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1.5px solid var(--gp-bordure);
    border-radius: 999px;
    background: #fff;
    color: var(--gp-gris);
    font-size: 12.5px;
    white-space: nowrap;
}

.fp-modif-puce svg {
    width: 12px;
    height: 12px;
    stroke: #1f9d6b;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fp-modif-puce-ok {
    color: #14583f;
    border-color: #bfe3d2;
    background: #eaf6f0;
}

.fp-modif-puce-cur {
    color: #fff;
    border-color: var(--gp-bleu-primaire);
    background: var(--gp-bleu-primaire);
    font-weight: 700;
}

@media (min-width: 992px) {
    .fp-modif-bandeau {
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas: "ligne puces retour";
    }

    .fp-modif-puces {
        margin-right: 2px;
        max-width: 48vw;
    }
}

@media (max-width: 991px) {
    .fp-modif-bandeau {
        margin: -24px -16px 16px;
    }
}

@media (max-width: 767px) {
    /* Correction P (lot 30, constat 2) : .form-main garde 25 px de rembourrage sous 992 px ; le débord
       de -12 px laissait 13 px perdus de chaque côté (bandeau de 332 px pour une carte de 358 px à 390 px).
       Le bandeau rejoint les bords de la carte comme sur la maquette validée : le titre gagne 26 px. */
    .fp-modif-bandeau {
        margin: -25px -25px 14px;
    }

    /* Le titre « Vous modifiez août 2026 » n'est jamais tronqué par des points de suspension :
       quand la place manque (360 px, mois longs), il passe sur deux lignes équilibrées
       (text-wrap: balance, simple enrichissement progressif). Disposition de la maquette inchangée. */
    .fp-modif-texte b {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        text-wrap: balance;
    }
}

/* Ligne des champs verrouillés : sous la carte de l'étape affichée (déplacée par generate.js) */
.fp-modif-verrou {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 16px;
    padding: 9px 11px;
    border: 1.5px dashed #c9d3e6;
    border-radius: 10px;
    background: #f3f5f9;
    color: var(--gp-gris);
    font-size: 13px;
    line-height: 1.4;
}

.fp-modif-verrou[hidden] {
    display: none;
}

.step-content > .fp-modif-verrou {
    margin-top: 12px;
}

.fp-modif-verrou svg {
    width: 16px;
    height: 16px;
    flex: none;
    stroke: var(--gp-gris);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fp-modif-verrou b {
    color: #1d2a44;
}

/* Actions du bas : barre collante sous 768 px, alignées à droite au-dessus */
.fp-modif-actions {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    padding: 12px 0 16px;
}

.fp-modif-actions[hidden] {
    display: none;
}

.fp-modif-enregistrer {
    min-height: var(--touch-target-min, 44px);
    padding: 13px 26px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gp-orange-clair, #fbb03b), var(--gp-orange, #f7931e));
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(247, 147, 30, 0.3);
}

.fp-modif-enregistrer[disabled] {
    opacity: 0.7;
    cursor: wait;
}

.fp-modif-sans {
    min-height: var(--touch-target-min, 44px);
    padding: 8px 10px;
    border: 0;
    background: transparent;
    color: var(--gp-bleu-primaire);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.fp-modif-enregistrer:focus-visible,
.fp-modif-sans:focus-visible,
.fp-modif-retour:focus-visible {
    outline: 2px solid var(--gp-bleu-primaire);
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .fp-modif-actions {
        position: sticky;
        bottom: 0;
        z-index: var(--z-sticky, 200);
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin: 0 -25px;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        border-top: 1px solid var(--gp-bordure);
    }

    .fp-modif-enregistrer {
        width: 100%;
        padding: 13px;
    }

    .fp-modif-sans {
        text-align: center;
    }
}

/* Aperçu derrière le panier pendant une modification : le bouton sous l'aperçu
   porte le libellé « Enregistrer … et revenir au panier » (même action) */
body.fp-modification .apercu-actions .btn-download-pdf {
    background: linear-gradient(135deg, var(--gp-orange-clair, #fbb03b), var(--gp-orange, #f7931e));
    box-shadow: 0 6px 14px rgba(247, 147, 30, 0.3);
}

/* ---- Aperçu : bouton « Agrandir » (A3-02), visible sous 992 px ou sur écran tactile ---- */
.fp-apercu-agrandir {
    display: none;
    align-items: center;
    gap: 7px;
    margin: 6px 0 2px 10px;
    padding: 7px 16px 7px 13px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gp-bleu-marine, #1e3760);
    background: #ffffff;
    border: 1.5px solid var(--gp-bleu-marine, #1e3760);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.fp-apercu-agrandir svg {
    flex: none;
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fp-apercu-agrandir:hover {
    background: #eef3fb;
}

.fp-apercu-agrandir:focus-visible {
    outline: 2px solid var(--gp-bleu-primaire);
    outline-offset: 2px;
}

.fp-apercu-agrandir[disabled] {
    opacity: 0.5;
    cursor: default;
}

@media (max-width: 991px), (pointer: coarse) {
    .fp-apercu-agrandir {
        display: inline-flex;
        min-height: var(--touch-target-min, 44px);
    }
}

.fp-modeles-commandes {
    flex-wrap: wrap;
    gap: 4px 6px;
}

/* ---- Accessibilité (A6-15) : focus visible sur les compteurs et leurs boutons ---- */
.input-spinner input:focus-visible,
.input-spinner-btn:focus-visible {
    outline: 2px solid var(--gp-bleu-primaire);
    outline-offset: -2px;
}

/* ---- Champs de 16 px sous 768 px (A3-03, ajout 2) : Safari sur iPhone n'agrandit
   plus la page au toucher d'un champ ; le zoom reste libre (aucun maximum-scale).
   Les largeurs des petits champs ne changent pas. ---- */
@media (max-width: 767px) {
    #bulletin-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    #bulletin-form select,
    #bulletin-form textarea,
    .form-main .form-group input,
    .form-main .form-group select,
    .cumul-inline-item input,
    .conges-inline-item input,
    .heures-sup-item input,
    .absence-item select,
    .absence-item input,
    .input-spinner input,
    .prime-item input,
    .prime-item select,
    .duree-autre-input,
    .taux-input,
    .email-input {
        font-size: 16px;
    }
}

/* ---- Correction P (lot 30, constat 1) : sous 768 px, les champs de 16 px restent dans leur piste.
   Un élément de grille ou de flexbox a « min-width: auto » (largeur minimale = largeur de son contenu) :
   une liste déroulante dont l'option la plus longue dépasse la piste 1fr élargit son groupe, la piste,
   puis tous les champs de la colonne, d'où le débordement de la carte et le défilement horizontal
   (déjà 5 px à 390 px avant le lot, 20 px avec les champs de 16 px ; 132 px à l'étape 4 : absences,
   congés). On annule cette largeur minimale sur les enfants directs des grilles et on borne les champs
   à la largeur de leur groupe, y compris un groupe passé en display: block par generate.js (le sélecteur
   « Motif de fin de contrat » gardait sa largeur intrinsèque, 415 px). Enfants directs seulement :
   les petits champs (compteurs, heures supplémentaires, absences) gardent leur largeur fixe.
   Rien ne change à partir de 768 px. ---- */
@media (max-width: 767px) {
    .form-grid > *,
    .form-grid-2cols > *,
    .form-grid-3cols > *,
    .absences-grid > *,
    .heures-sup-grid > *,
    .conges-inline-grid > *,
    .step4-accordion-content > div[style*="grid-template-columns"] > *,
    .prime-item > * {
        min-width: 0;
    }

    .form-group > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .form-group > select,
    .form-group > textarea,
    .periode-selects > select {
        width: 100%;
        box-sizing: border-box;
        min-width: 0;
    }
}

/* ---- Fenêtre de connexion : « Votre saisie est conservée. » (S2-04, A2-18) ---- */
#ssoModal .sso-saisie-conservee {
    margin: 10px 0 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: #eaf6f0;
    color: #14583f;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

#ssoModal .sso-saisie-conservee[hidden] {
    display: none;
}

/* ---- Lot 56 (29/10/2026, maquette validée par Fabien) : avertissements du calcul en simple information bleue.
   Fenêtre blanche aux coins arrondis, ombre douce, aucune bande colorée en tête ; une partie par famille
   (« À vérifier dans votre saisie » puis « Pour information ») : pastille ronde bleu clair avec un « i » bleu
   en SVG et titre gris très foncé ; chaque message dans un encadré bleu très clair à filet gauche bleu ;
   bouton unique « Continuer ». Construite par fpFenetreAvertissements() (generate.js), sous l'identifiant
   #notification-modal de la fenêtre du site (attente de fermeture inchangée). ---- */
.fp-info-fond {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.45);
    animation: fpInfoApparition 0.2s ease-out;
}

.fp-info-fenetre {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.fp-info-contenu {
    padding: 24px 24px 8px;
    overflow-y: auto;
}

.fp-info-partie + .fp-info-partie {
    margin-top: 20px;
}

.fp-info-entete {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
}

.fp-info-pastille {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e7eefb;
    color: #2b5bb5;
}

.fp-info-pastille svg {
    width: 20px;
    height: 20px;
    display: block;
}

.fp-info-titre {
    margin: 0;
    color: #1f2a44;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.fp-info-liste {
    margin: 0;
    padding: 0;
    list-style: none;
}

.fp-info-message {
    margin: 0 0 8px;
    padding: 10px 12px;
    background: #f5f8fd;
    border-left: 3px solid #2b5bb5;
    border-radius: 0 8px 8px 0;
    color: #2d3748;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    overflow-wrap: break-word;
}

.fp-info-pied {
    padding: 12px 24px 24px;
    text-align: right;
}

.fp-info-bouton {
    min-width: 140px;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    background: #1f3a8a;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.fp-info-bouton:hover {
    background: #1a3178;
}

.fp-info-bouton:focus-visible {
    outline: 3px solid #93b4ef;
    outline-offset: 2px;
}

@keyframes fpInfoApparition {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .fp-info-fond {
        animation: none;
    }
}

@media (max-width: 480px) {
    .fp-info-contenu {
        padding: 20px 16px 4px;
    }

    .fp-info-titre {
        font-size: 17px;
    }

    .fp-info-pied {
        padding: 12px 16px 16px;
    }

    .fp-info-bouton {
        width: 100%;
    }
}
