/**
 * 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, #1d458c 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: #ffffff;
    color: #1d458c;
    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 #e5e7eb;
}
.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: #1d458c;
    font-weight: 500;
    text-align: center;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
}
.flatpickr-year-dropdown-menu div:last-child {
    border-bottom: none;
}
.flatpickr-year-dropdown-menu div:hover {
    background: #e8f0fe;
    color: #1d458c;
}
.flatpickr-year-dropdown-menu div.selected {
    background: #10b981;
    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: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}
.flatpickr-weekday {
    color: #1d458c;
    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: #e8f0fe;
    border-color: #e8f0fe;
    color: #1d458c;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #10b981;
    border-color: #10b981;
    border-radius: 50%;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
.flatpickr-day.today {
    border-color: #10b981;
    color: #10b981;
    font-weight: 700;
}
.flatpickr-day.today:hover {
    background: #10b981;
    border-color: #10b981;
    color: white;
}
.flatpickr-day.today.selected {
    background: #10b981;
    border-color: #10b981;
    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: #f3f4f6;
    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;
    --success: #28a745;
    --success-light: #d4edda;
    --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(--primary) 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, #4ade80, var(--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(--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(--success);
    border-color: var(--success);
}

.form-step.active .step-icon {
    background: white;
    color: var(--primary);
    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(--primary);
    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, #f8fafc, #f1f5f9);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid #1d458c;
    min-width: 100px;
    text-align: center;
}

.step4-kpi-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #6b7280;
    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: #1d458c;
    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 #e5e7eb;
    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(--primary);
    box-shadow: 0 0 0 4px rgba(29, 69, 140, 0.1);
}

.form-group input[readonly] {
    background: #f9fafb;
    color: #6b7280;
}

.form-group small {
    color: #9ca3af;
    font-size: 12px;
    margin-top: 4px;
}

/* Input rempli = fond vert */
.form-group input.filled,
.form-group select.filled {
    border-color: var(--success) !important;
    background: linear-gradient(to right, var(--success-light), 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: #1d458c;
    border-color: #1d458c;
}

.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: #6b7280;
    font-weight: 500;
}

.checkbox-inline:hover .checkbox-custom {
    border-color: #1d458c;
}

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

.form-group input:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
    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 #e5e7eb;
    border-top-color: #1d458c;
    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 #e5e7eb;
    border-radius: 12px;
    overflow: visible;
    background: white;
}

.step4-accordion-item {
    border-bottom: 1px solid #e5e7eb;
}

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

.step4-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.step4-accordion-header:hover {
    background: #f1f5f9;
}

.step4-accordion-header.open {
    background: #e8f0fe;
    border-bottom: 1px solid #e5e7eb;
}

.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: #1d458c;
}

.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: #e8f0fe;
    color: #1d458c;
}

.step4-accordion-arrow {
    transition: transform 0.2s;
    color: #6b7280;
}

.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, #f8fafc, #f1f5f9);
    border-radius: 10px;
    padding: 16px;
    border-left: 4px solid #1d458c;
}

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

.recap-card-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recap-card-value {
    font-size: 18px;
    font-weight: 700;
    color: #1d458c;
}

.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 #f1f5f9;
}

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

.detail-row-label {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.detail-row-value.primary {
    color: #1d458c;
}

/* É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: #6b7280;
    font-weight: 500;
}

.element-variable-item input {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

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

.element-variable-item input:disabled {
    background: #f9fafb;
    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: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.cumul-inline-item.editable {
    border-color: #1d458c;
    background: #f0f7ff;
}

.cumul-inline-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.cumul-inline-value {
    font-size: 16px;
    font-weight: 700;
    color: #1d458c;
}

.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: #1d458c;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-modifier-small:hover {
    background: #e8f0fe;
    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: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.conges-inline-label {
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.conges-inline-value {
    font-size: 18px;
    font-weight: 700;
    color: #1d458c;
}

.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: #854d0e;
}

.heures-sup-item input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #fde047;
    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;
}

.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 #fde047;
}

.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: #854d0e;
}

.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: #1d458c;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-modifier-cumuls:hover,
.btn-modifier-conges:hover {
    background: #e8f0fe;
    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: #f3f4f6;
    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: #10b981;
}
.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: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.prime-item select,
.prime-item input {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}
.prime-item input[type="number"] {
    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 #10b981;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}
.btn-add-prime:hover {
    background: #d1fae5;
    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 #e5e7eb;
}
.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 #e5e7eb;
}

/* 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 #e5e7eb;
    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: #6b7280;
    border: 2px solid #e5e7eb;
}

.btn-prev:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

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

.btn-next {
    background: var(--primary);
    color: white;
}

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

.btn-submit {
    background: var(--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;
    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: #1d458c;
    margin-bottom: 24px;
}

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

.resultat-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.resultat-card.highlight {
    background: #1d458c;
    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: #1d458c;
    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: #6b7280;
    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: #ffffff;
    border: 2px solid #1d458c;
    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 #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.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 #1d458c;
    padding-left: 14px;
    cursor: pointer !important;
}

.entreprise-option strong {
    color: #1d458c;
    font-size: 15px;
    font-weight: 700;
}

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

.entreprise-option span {
    font-size: 13px;
    color: #6b7280;
    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 #1d458c;
    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 #f3f4f6;
    font-size: 14px;
    transition: background 0.15s;
}

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

.autocomplete-item .idcc-num {
    font-weight: 700;
    color: #1d458c;
    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 #1d458c;
    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: #1d458c;
    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: #1d458c;
    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;
    }
}

/* =====================================================
   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 #e5e7eb;
    text-align: center;
}

.cgu-brand-name {
    font-size: 28px;
    font-weight: 700;
    color: #1d458c;
    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: #f8fafc;
    border: 2px solid #1d458c;
    border-radius: 10px;
    color: #1d458c;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.cgu-link:hover {
    background: #1d458c;
    color: white;
}

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

/* Bouton accepter CGU (remplace checkbox + continuer) */
.btn-accept-cgu {
    width: 100%;
    padding: 14px 20px;
    background: #1d458c;
    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 #e5e7eb;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s;
}

.btn-cgu-cancel:hover {
    background: #f3f4f6;
    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: #1d458c;
    font-weight: 700;
}

.email-modal-header p {
    margin: 8px 0 0 0;
    color: #6b7280;
    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 #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.email-input:focus {
    outline: none;
    border-color: #1d458c;
    box-shadow: 0 0 0 3px rgba(29, 69, 140, 0.1);
}

.email-input.error {
    border-color: #ef4444;
}

.email-error-msg {
    color: #ef4444;
    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 #e5e7eb;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: #6b7280;
    transition: all 0.2s;
}

.btn-email-cancel:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.btn-email-submit {
    flex: 2;
    padding: 14px 20px;
    background: #1d458c;
    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: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 180px;
}

.effectif-option:hover {
    border-color: #1d458c;
    background: #f0f4ff;
}

.effectif-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #1d458c;
    cursor: pointer;
}

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

.effectif-option input[type="radio"]:checked + .effectif-label {
    color: #1d458c;
    font-weight: 600;
}

.effectif-option:has(input:checked) {
    border-color: #1d458c;
    background: #eff6ff;
}

/* =====================================================
   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 #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #ffffff;
}

.duree-hebdo-radios .radio-label:hover {
    border-color: #1d458c;
    background: #f8fafc;
}

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

.duree-hebdo-radios .radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #10b981;
    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: #6b7280;
    font-size: 0.75rem;
    margin-left: 2px;
}

.duree-autre-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.duree-autre-input:focus {
    outline: none;
    border-color: #10b981;
    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: #10b981;
    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: #6b7280;
    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: #f3f4f6;
    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: #f8f9fa;
    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;
    }
}

/* ========================================
   INDICATION "PINCEZ POUR ZOOMER"
   Affiché uniquement sur mobile/tablette
   ======================================== */
.preview-zoom-hint {
    text-align: center;
    font-size: var(--font-size-xs, 12px);
    color: #6b7280;
    padding: var(--space-xs, 4px) var(--space-sm, 8px);
    background: #f9fafb;
    border-radius: 4px;
    margin-top: var(--space-sm, 8px);
    display: none; /* Masqué par défaut */
}

/* Afficher sur mobile et tablette */
@media (max-width: 991px) {
    .preview-zoom-hint {
        display: block;
    }
}

/* Masquer sur desktop */
@media (min-width: 992px) {
    .preview-zoom-hint {
        display: none;
    }
}


/* ===== OAUTH GOOGLE ===== */
.oauth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 16px 0;
    color: #6b7280;
    font-size: 14px;
}

.oauth-separator::before,
.oauth-separator::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

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

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    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: #f8f9fa;
    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: #ffffff;
    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: #ffffff;
    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: #fff;
    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: #1d458c;
    font-size: 15px;
    font-weight: 500;
}

.stripe-redirect-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #1d458c;
    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: #ffffff;
    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: #f1f5f9;
    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 #f1f5f9;
}

/* 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, #1d458c, #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: #f8fafc;
    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: #f1f5f9;
    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: #ffffff;
    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, #1d458c 0%, #152d5c 100%);
    color: white;
}

.modal-taux-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.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: #f1f5f9;
}

.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: #f8fafc;
    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 #f1f5f9;
}

.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: #ffffff;
}

.taux-input:focus {
    outline: none;
    border-color: #1d458c;
    box-shadow: 0 0 0 3px rgba(29, 69, 140, 0.1);
}

.taux-input.taux-disabled {
    background: #f8fafc;
    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: #f8fafc;
    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: #ffffff;
    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: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.btn-taux-annuler {
    padding: 10px 20px;
    background: #ffffff;
    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: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-taux-appliquer {
    padding: 10px 24px;
    background: #10b981;
    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;
    }
}
