/**
 * PaieLab™ - Simulateur Brut/Net
 * Style conforme à la maquette validée (Variante 3 Dashboard)
 *
 * @copyright 2025-2026 Purple Telecom EURL
 */

/* ===========================================
   VARIABLES CSS
   =========================================== */
:root {
    /* Branding Fiche-Paie.fr */
    --gp-bleu-marine: #1a3a5c;
    --gp-bleu-clair: #2a5298;
    --gp-blanc: #ffffff;
    --gp-gris-clair: #f8f9fa;
    --gp-gris: #6c757d;
    --gp-gris-dark: #495057;

    /* Vert émeraude fiche-paie.fr */
    --gp-vert-emeraude: #10B981;
    --gp-vert-emeraude-dark: #059669;
    --gp-vert-emeraude-light: #D1FAE5;

    /* Accents */
    --gp-orange: #F59E0B;
    --gp-orange-light: #FEF3C7;
}

/* ===========================================
   PAGE HEADER
   =========================================== */
.page-header {
    background: linear-gradient(135deg, var(--gp-bleu-marine) 0%, var(--gp-bleu-clair) 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: white !important;
}

.page-header p {
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.page-header .product-name {
    color: var(--gp-vert-emeraude-light);
    font-weight: 700;
}

.page-header .product-name sup {
    font-size: 0.5em;
    vertical-align: super;
}

/* ===========================================
   SIMULATOR CONTAINER
   =========================================== */
.simulator-container {
    max-width: 1200px;
    margin: -30px auto 40px;
    padding: 0 20px;
}

.simulator-wrapper {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.1);
    overflow: hidden;
}

.simulator-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 600px;
}

/* ===========================================
   SIDEBAR
   =========================================== */
.simulator-sidebar {
    background: var(--gp-gris-clair);
    padding: 30px 25px;
    border-right: 1px solid #e0e0e0;
}

.sidebar-title {
    color: var(--gp-bleu-marine);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--gp-bleu-marine);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-title svg {
    width: 20px;
    height: 20px;
}

/* Sidebar header with mode toggle */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--gp-bleu-marine);
}

.sidebar-header .sidebar-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Mode toggle (Mensuel/Annuel) */
.mode-toggle {
    display: flex;
    background: #e0e0e0;
    border-radius: 6px;
    padding: 2px;
    flex-shrink: 0;
}

.mode-btn {
    padding: 5px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--gp-gris);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mode-btn.active {
    background: var(--gp-bleu-marine);
    color: white;
    box-shadow: 0 1px 4px rgba(26, 58, 92, 0.3);
}

.mode-btn:hover:not(.active) {
    background: rgba(255,255,255,0.5);
}

/* Form groups */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--gp-gris);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group label svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gp-bleu-clair);
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.form-group input.large-input {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

/* Input with suffix (€ symbol) */
.input-with-suffix {
    position: relative;
}

.input-with-suffix input {
    padding-right: 45px;
    text-align: center;
}

.input-with-suffix .suffix {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gp-bleu-marine);
    pointer-events: none;
}

/* Select styling */
.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Toggle group */
.toggle-group {
    display: flex;
    background: #e0e0e0;
    border-radius: 10px;
    padding: 4px;
}

.toggle-btn {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    background: transparent;
    color: var(--gp-gris);
}

.toggle-btn.active {
    background: var(--gp-bleu-marine);
    color: white;
    box-shadow: 0 2px 8px rgba(26, 58, 92, 0.3);
}

.toggle-btn:hover:not(.active) {
    background: rgba(255,255,255,0.5);
}

/* Slider */
.slider-container {
    margin-top: 5px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.slider-value {
    background: var(--gp-bleu-marine);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gp-bleu-marine);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gp-bleu-marine);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Slider Brut - sous l'input */
.slider-brut {
    margin-top: 10px;
}

.slider-brut .slider {
    height: 4px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--gp-gris);
    margin-top: 4px;
}

/* Bouton SMIC cliquable */
.btn-smic {
    background: transparent;
    border: 1px solid var(--gp-bleu-marine);
    color: var(--gp-bleu-marine);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn-smic:hover {
    background: var(--gp-bleu-marine);
    color: white;
}

.btn-smic:active {
    transform: scale(0.95);
}

/* Slider Taux PAS - sous l'input */
.slider-taux {
    margin-top: 8px;
}

.slider-taux .slider {
    height: 4px;
}

/* Input taux avec bouton reset */
.taux-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.taux-input-container input {
    flex: 1;
    padding-right: 35px;
}

.taux-input {
    font-weight: 600;
    text-align: center;
}

/* Bouton reset taux */
.btn-reset-taux {
    background: var(--gp-gris-clair);
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    color: var(--gp-gris);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-reset-taux:hover {
    background: var(--gp-bleu-clair);
    border-color: var(--gp-bleu-clair);
    color: white;
}

.btn-reset-taux.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Badge mode taux */
.taux-mode-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    margin-left: auto;
}

.taux-mode-badge.auto {
    background: var(--gp-vert-emeraude-light);
    color: var(--gp-vert-emeraude-dark);
}

.taux-mode-badge.manuel {
    background: var(--gp-orange-light);
    color: var(--gp-orange);
}

/* Slider vert (augmentation) */
.slider.slider-green::-webkit-slider-thumb {
    background: var(--gp-vert-emeraude);
}

.slider.slider-green::-moz-range-thumb {
    background: var(--gp-vert-emeraude);
}

/* Augmentation card styles */
.augmentation-slider-container {
    margin-bottom: 12px;
}

.augmentation-slider-container .slider-container {
    margin-bottom: 12px;
}

.augmentation-slider-container .slider-header .slider-value {
    background: var(--gp-vert-emeraude);
}

.augmentation-custom {
    background: var(--gp-vert-emeraude-light);
    border-radius: 8px;
    padding: 10px 12px !important;
    margin: 4px 0;
}

.augmentation-custom .value {
    font-size: 1rem;
}

.augmentation-divider {
    height: 1px;
    background: #e8e8e8;
    margin: 16px 0 12px;
}

.augmentation-defaults {
    opacity: 0.8;
}

.augmentation-defaults .detail-row {
    padding: 6px 0;
    font-size: 0.8rem;
}

/* CTA Button */
.cta-button {
    width: 100%;
    background: linear-gradient(135deg, var(--gp-vert-emeraude) 0%, var(--gp-vert-emeraude-dark) 100%);
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-top: 25px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    text-decoration: none;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.cta-button svg {
    width: 18px;
    height: 18px;
}

/* ===========================================
   MAIN CONTENT
   =========================================== */
.simulator-main {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #f0f2f5;
}

/* Résultat principal */
.main-result {
    background: linear-gradient(135deg, var(--gp-bleu-marine) 0%, var(--gp-bleu-clair) 100%);
    border-radius: 16px;
    padding: 30px;
    color: white;
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.result-item {
    flex: 1;
    padding: 0 15px;
}

.result-item:not(:last-child) {
    border-right: 1px solid rgba(255,255,255,0.2);
}

.result-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.result-label svg {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

.result-amount {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.result-period {
    font-size: 0.85rem;
    opacity: 0.7;
}

.result-item.highlight .result-amount {
    color: #90EE90;
}

/* ===========================================
   INFO BOX
   =========================================== */
.info-box {
    background: var(--gp-vert-emeraude-light);
    border-left: 4px solid var(--gp-vert-emeraude);
    border-radius: 0 10px 10px 0;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--gp-vert-emeraude-dark);
}

.info-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ===========================================
   DETAILS GRID
   =========================================== */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.detail-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    border: 1px solid #e8e8e8;
    transition: all 0.2s;
}

.detail-card:hover {
    border-color: var(--gp-bleu-clair);
    box-shadow: 0 4px 15px rgba(42, 82, 152, 0.1);
}

.detail-card-header {
    font-size: 0.75rem;
    color: var(--gp-gris);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-card-header .icon-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-card-header .icon-circle svg {
    width: 14px;
    height: 14px;
}

.detail-card-header .icon-circle.blue {
    background: rgba(42, 82, 152, 0.1);
    color: var(--gp-bleu-clair);
}

.detail-card-header .icon-circle.green {
    background: var(--gp-vert-emeraude-light);
    color: var(--gp-vert-emeraude);
}

.detail-card-header .icon-circle.orange {
    background: var(--gp-orange-light);
    color: var(--gp-orange);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.85rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    color: var(--gp-gris);
}

.detail-row .value {
    font-weight: 600;
    color: var(--gp-bleu-marine);
}

.detail-row .value.green {
    color: var(--gp-vert-emeraude);
}

.detail-row .value.orange {
    color: var(--gp-orange);
}

.detail-row .value.muted {
    color: var(--gp-gris);
    font-weight: 500;
    font-size: 0.8rem;
}

/* Sous-détails (CSG, Fillon) */
.detail-row.sub-detail {
    padding: 4px 0 4px 16px;
    font-size: 0.75rem;
    opacity: 0.85;
    border-bottom: none;
}

.detail-row.sub-detail .label {
    font-size: 0.75rem;
    color: var(--gp-gris);
}

.detail-row.fillon-row {
    background: rgba(16, 185, 129, 0.08);
    border-radius: 6px;
    padding: 6px 12px !important;
    margin: 4px 0;
}

/* ===========================================
   FAQ SECTION
   =========================================== */
.simulateur-faq {
    background: white;
    padding: 48px 24px 56px;
}

.faq-container {
    max-width: 1000px;
    margin: 0 auto;
}

.simulateur-faq h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gp-bleu-marine);
    text-align: center;
    margin: 0 0 32px 0;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.faq-item {
    background: var(--gp-gris-clair);
    padding: 20px;
    border-radius: 12px;
}

.faq-item h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gp-bleu-marine);
    margin: 0 0 8px 0;
}

.faq-item p {
    font-size: 0.875rem;
    color: var(--gp-gris-dark);
    margin: 0;
    line-height: 1.6;
}

/* ===========================================
   PAGE FOOTER
   =========================================== */
.page-footer {
    text-align: center;
    padding: 30px;
    color: var(--gp-gris);
    font-size: 0.85rem;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 900px) {
    .simulator-layout {
        grid-template-columns: 1fr;
    }

    .simulator-sidebar {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .main-result {
        flex-direction: column;
        gap: 20px;
    }

    .result-item {
        padding: 15px 0;
    }

    .result-item:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .page-header h1 {
        font-size: 1.5rem;
    }

    .simulator-sidebar,
    .simulator-main {
        padding: 20px;
    }

    .result-amount {
        font-size: 1.75rem;
    }

    .simulateur-faq {
        padding: 32px 16px 40px;
    }
}

/* ===========================================
   ANIMATIONS
   =========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-card {
    animation: fadeIn 0.3s ease-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.result-amount.updating,
.value.updating {
    animation: pulse 0.2s ease;
}

/* ===========================================
   PRINT
   =========================================== */
@media print {
    .simulator-sidebar {
        display: none;
    }

    .simulator-layout {
        grid-template-columns: 1fr;
    }

    .main-result {
        background: #1a3a5c !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
