/* ============================================
   LE CASIER CONNECTÉ - Configurateur CSS
   Inspired by lecasierconnecte.fr
   ============================================ */

/* Variables CSS - Charte Graphique Phase 2 */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
    /* --- DESIGN SYSTEM TOKENS (PHASE 2) --- */

    /* Palette de Couleurs */
    --color-primary: #181818;
    /* Texte principal, Headers, Dark backgrounds */
    --color-secondary: #F9F8F4;
    /* Fond de contenu, Cartes */
    --color-accent: #005487;
    /* Liens, Interactif secondaire */
    --color-cta: #AAEA39;
    /* Actions principales (Green Lime) */
    --color-cta-hover: #98D630;
    --color-error: #E74C3C;
    --color-border: #E5E5E5;
    --bg-white: #FFFFFF;

    /* Typographie */
    --font-family-base: 'Montserrat', sans-serif;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;

    /* Effets & Layout */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    /* Updated for softer look */
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --radius-sm: 4px;
    /* More angular per new specs */
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 50px;

    /* --- LEGACY COMPATIBILITY MAPPING --- */
    /* Mapping old variable names to new tokens to prevent breaking existing UI */
    --primary-color: var(--color-cta);
    /* Old primary (lime) -> New CTA */
    --primary-dark: #8BC42A;
    /* Keep for gradients if needed */
    --primary-light: #C5F062;
    --accent-color: var(--color-accent);
    --bg-color: var(--color-secondary);
    --text-dark: var(--color-primary);
    --text-light: #666666;
    --text-on-primary: #1A1A1A;
    --border-color: var(--color-border);
    --font-primary: var(--font-family-base);
}

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

body {
    font-family: var(--font-family-base);
    background-color: var(--bg-color);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
}

/* ============================================
   HEADER
   ============================================ */
header {
    background: #1B1D33;
    color: #F9F8F4;
    padding: 24px 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
    color: #F9F8F4;
}

/* Logo Styling */
.header-logo {
    display: inline-block;
    vertical-align: middle;
}

.logo-img {
    height: 48px;
    /* Adjustable height */
    width: auto;
    display: block;
    margin-bottom: 4px;
}

header .subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
    position: relative;
    z-index: 1;
    color: #F9F8F4;
}

/* Header content layout */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-email {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1A1A1A;
    opacity: 0.8;
}

.btn-logout {
    background: #1B1D33;
    color: #F9F8F4;
    padding: 8px 16px;
    border: 1px solid rgba(249, 248, 244, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-primary);
}

.btn-logout:hover {
    background: rgba(26, 26, 31, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}


/* Indicateur d'étapes */
.steps-indicator {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(249, 248, 244, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #F9F8F4;
}

.step.active .step-number {
    background: #F9F8F4;
    color: #1B1D33;
}

.step-name {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
.app-container {
    display: flex;
    gap: 24px;
    padding: 24px;
    max-width: 1440px;
    margin: 0 auto;
}

/* ============================================
   PANNEAU DES MODULES
   ============================================ */
.modules-panel {
    flex: 0 0 300px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.modules-panel h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
}

.modules-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Carte de module */
.module-card {
    background: var(--bg-color);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.module-card::after {
    content: '+';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.2s;
}

.module-card:hover {
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.module-card:hover::after {
    opacity: 1;
}

.module-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.module-card .module-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.module-card .module-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 8px;
}


/* Module Visual (SVG) */
.module-visual {
    width: 100%;
    height: 160px;
    /* Hauteur fixe pour l'homogénéité */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 8px;
}

.module-visual svg {
    max-height: 100%;
    width: auto;
}

.module-card .module-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
    display: none;
    /* Hiding prices */
}

.module-card.console {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-color: var(--primary-light);
}

.module-card.console:hover {
    border-color: var(--primary-color);
}

/* ============================================
   CATÉGORIES DU CATALOGUE
   ============================================ */
.category-section {
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
}

.category-header {
    padding: 12px 14px;
    background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    user-select: none;
}

.category-header:hover {
    background: linear-gradient(135deg, #ebebeb 0%, #e0e0e0 100%);
}

.category-icon {
    font-size: 0.8rem;
    color: var(--text-light);
    transition: transform 0.2s;
}

.category-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.category.btn-logout {
    background: #1A1A1F;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-family: var(--font-family-base);
}

.category-count {
    background: var(--primary-color);
    color: var(--text-on-primary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 8px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.category-section.open .category-content {
    max-height: 2000px;
    padding: 8px;
}

.category-section:not(.open) .category-icon {
    transform: rotate(-90deg);
}

/* Module cards styles dans les catégories */
.module-card.principal {
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(135deg, #f9fff0 0%, #f0ffe0 100%);
}

.module-card.secondaire {
    border-left: 4px solid #64B5F6;
    background: linear-gradient(135deg, #f0f8ff 0%, #e3f2fd 100%);
}

.module-card.principal:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(170, 234, 58, 0.3);
}

.module-card.secondaire:hover {
    border-color: #64B5F6;
    box-shadow: 0 2px 8px rgba(100, 181, 246, 0.3);
}

.module-type-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    color: var(--text-light);
}

/* Config chip styles */
.config-chip.principal {
    background: linear-gradient(135deg, #f9fff0 0%, #e8f5e9 100%);
    border-color: var(--primary-light);
}

.config-chip.secondaire {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #90CAF9;
}

/* ============================================
   CONTENU PRINCIPAL
   ============================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sections */
.config-section,
.preview-section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Liste de configuration */
.config-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 50px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    border: 2px dashed var(--border-color);
}

.config-list .empty-message {
    color: var(--text-light);
    font-style: italic;
    margin: auto;
    font-size: 0.9rem;
}

/* Chip de module */
.config-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: fadeIn 0.2s ease;
    box-shadow: var(--shadow-sm);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.config-chip.console {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-color: var(--primary-light);
}

.config-chip .chip-remove {
    background: none;
    border: none;
    color: #EF5350;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s;
}

.config-chip .chip-remove:hover {
    transform: scale(1.3);
}

/* Messages de validation */
#validation-messages {
    margin-top: 12px;
}

.validation-error {
    background: #FFEBEE;
    color: #C62828;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    border-left: 4px solid #EF5350;
    margin-bottom: 8px;
}

.validation-warning {
    background: #FFF3E0;
    color: #E65100;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    border-left: 4px solid #FF9800;
    margin-bottom: 8px;
}

.info-mandatory {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 10px 0 0;
    font-style: italic;
}

.module-reorder-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-top: 12px;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary-light);
    animation: slideIn 0.2s ease;
}

#selected-module-info {
    font-weight: 600;
    color: var(--primary-dark);
}

/* Prévisualisation */
.preview-section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

#casier-container {
    background: linear-gradient(180deg, #FAFAFA 0%, #F0F0F0 100%);
    border-radius: var(--radius-sm);
    padding: 24px;
    min-height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

/* ============================================
   PANNEAU D'INFO / RÉCAPITULATIF
   ============================================ */
.info-panel {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 16px;
}

.info-item {
    text-align: center;
    padding: 12px 24px;
}

.info-item.highlight {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-on-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: none;
    /* Hiding total price */
}

.info-item.highlight .info-label {
    color: rgba(255, 255, 255, 0.85);
}

.info-item.highlight .info-value {
    color: var(--text-on-primary);
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 500;
}

.info-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
}

.info-value.price {
    font-size: 1.6rem;
}

/* ============================================
   TOGGLE VUE 2D / 3D
   ============================================ */
.view-toggle-container {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.view-toggle {
    background: #E0E0E0;
    /* Gris clair fond */
    border-radius: var(--radius-full);
    padding: 4px;
    display: flex;
    position: relative;
    cursor: pointer;
    width: 200px;
    /* Largeur fixe pour le toggle */
    height: 48px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-toggle input[type="radio"] {
    display: none;
}

.view-toggle label {
    flex: 1;
    text-align: center;
    z-index: 2;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-light);
    transition: color 0.3s ease;
    border-radius: var(--radius-full);
}

/* Slider animation */
.view-toggle .toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    /* Moitié moins le padding */
    height: calc(100% - 8px);
    background: #1B1D33;
    /* New color scheme */
    border-radius: var(--radius-full);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(249, 248, 244, 0.2);
}

/* État actif : 2D (gauche) - par défaut slider à gauche */

/* État actif : 3D (droite) */
#view-3d:checked~.toggle-slider,
#view-color-3d:checked~.toggle-slider {
    transform: translateX(100%);
    /* Bouge de 100% de sa propre largeur + un peu de gap si besoin */
    transform: translateX(96px);
    /* 200px total -> ~100px par bouton. Ajustement précis */
}

/* Ajustement précis du slider basé sur la largeur fixe */
#view-3d:checked~.toggle-slider,
#view-color-3d:checked~.toggle-slider {
    transform: translateX(92px);
    /* 200px - 8px padding = 192px width content. Half is 96. */
}

/* Couleurs de texte quand actif */
#view-2d:checked+label,
#view-color-2d:checked+label {
    color: white;
}

#view-3d:checked+label,
#view-color-3d:checked+label {
    color: white;
}

/* Container preview unifié */
.preview-container {
    background: linear-gradient(180deg, #FAFAFA 0%, #F0F0F0 100%);
    border-radius: var(--radius-sm);
    padding: 24px;
    min-height: 400px;
    /* Plus grand pour la 3D */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    position: relative;
    transition: opacity 0.3s ease;
}

.preview-container.hidden {
    display: none;
}

#casier-3d-container {
    background: #f5f5f5;
    /* Match Three.js background */
    padding: 0;
    /* Pas de padding pour le canvas */
    overflow: hidden;
}

.preview-hint.hidden {
    display: none;
}

/* ============================================
   BARRE D'INFO CONFIGURATION
   ============================================ */
.config-info-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    padding: 16px 20px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.config-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-info-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
}

.config-info-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.config-info-item.highlight {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.config-info-item.highlight .config-info-label {
    color: rgba(0, 0, 0, 0.7);
}

.config-info-item.highlight .config-info-value {
    color: #1A1A1A;
    font-size: 1.1rem;
}

.config-info-bar .btn-download {
    margin-left: auto;
}

/* ============================================
   BOUTONS
   ============================================ */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.25s ease;
    font-family: var(--font-primary);
}

.btn-danger {
    background: #EF5350;
    color: white;
}

.btn-danger:hover {
    background: #E53935;
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.3);
}

.btn-secondary {
    background: #1B1D33;
    color: #F9F8F4;
    border: 1px solid rgba(249, 248, 244, 0.2);
}

.btn-secondary:hover {
    background: rgba(27, 29, 51, 0.9);
    box-shadow: 0 4px 12px rgba(27, 29, 51, 0.3);
}

.btn-download {
    background: #1B1D33;
    color: #F9F8F4;
    padding: 12px 24px;
    font-size: 0.95rem;
    border: 1px solid rgba(249, 248, 244, 0.2);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 29, 51, 0.4);
}

.btn-next-step {
    background: #1B1D33;
    color: #F9F8F4;
    padding: 14px 32px;
    font-size: 1rem;
    border: 1px solid rgba(249, 248, 244, 0.2);
}

.btn-next-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 29, 51, 0.4);
}

/* ============================================
   SECTION ÉTAPE SUIVANTE
   ============================================ */
.next-step-section {
    text-align: center;
    padding: 24px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   SECTION SÉLECTION COULEURS
   ============================================ */
.color-section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.color-preview-container {
    background: linear-gradient(180deg, #FAFAFA 0%, #F0F0F0 100%);
    border-radius: var(--radius-sm);
    padding: 24px;
    margin: 16px 0;
    min-height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
}

.color-preview-section {
    margin: 24px 0;
}

.color-preview-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.colors-panel {
    margin: 24px 0;
}

.colors-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.color-option {
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: var(--radius-sm);
    padding: 8px;
    transition: all 0.25s ease;
    background: var(--bg-color);
}

.color-option:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.color-option.selected {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.color-swatch {
    width: 100%;
    height: 80px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.color-name {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* ============================================
   PANNEAU OPTIONS
   ============================================ */
.options-panel {
    margin: 24px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.options-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.option-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.option-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
}

.option-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.option-checkmark {
    display: none;
}

.option-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.option-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-left: 32px;
    margin-top: 4px;
}

.option-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
    padding-left: 16px;
    display: none;
    /* Hiding option prices */
}

.option-item:has(.option-checkbox:checked) {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f9fff0 0%, #f0ffe0 100%);
}

@media (max-width: 600px) {
    .option-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .option-price {
        padding-left: 32px;
    }
}

.selected-case-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    margin: 16px 0;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary-light);
}

.case-info-text {
    font-weight: 600;
    color: var(--primary-dark);
}

.current-color-display {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    vertical-align: middle;
    margin-left: 8px;
}

/* Récapitulatif dans section couleurs */
.color-config-summary {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border-radius: var(--radius-md);
    padding: 20px 32px;
    margin: 32px 0 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    border: 2px solid var(--primary-color);
}

.summary-info {
    display: flex;
    gap: 48px;
    align-items: center;
    flex: 1;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}


.summary-item.highlight {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    display: none;
    /* Hiding total price summary */
}

.summary-item.highlight .summary-label {
    color: #1A1A1A;
}

.summary-item.highlight .summary-value {
    color: #1A1A1A;
}

.price-large {
    font-size: 1.5rem;
}

.btn-download-large {
    background: var(--primary-color);
    color: #1A1A1A;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    border-radius: var(--radius-full);
}

.btn-download-large:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .color-config-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .summary-info {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .btn-download-large {
        width: 100%;
    }
}

.color-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

#color-preview-casier rect.selected-for-color {
    stroke: var(--primary-dark);
    stroke-width: 4;
    filter: drop-shadow(0 0 8px var(--primary-color));
}

/* ============================================
   VUE 3D
   ============================================ */
.preview-3d-toggle {
    text-align: center;
    margin: 8px 0;
}

.btn-3d {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 14px 32px;
    font-size: 1rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.btn-3d:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.preview-3d {
    background: linear-gradient(180deg, #1A2332 0%, #0D1421 100%);
    border: 2px solid var(--primary-color);
}

.preview-3d h2 {
    color: white;
}

.preview-3d .hint {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin: 0 0 16px;
    text-align: center;
}

#casier-3d-container {
    width: 100%;
    height: 420px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* ============================================
   REORDER CONTROLS
   ============================================ */
.reorder-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    margin-top: 14px;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary-light);
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#selected-case-info {
    font-weight: 600;
    color: var(--primary-dark);
}

.reorder-buttons {
    display: flex;
    gap: 10px;
}

.btn-reorder {
    background: var(--primary-color);
    color: white;
    padding: 10px 16px;
    font-size: 0.9rem;
}

.btn-reorder:hover {
    background: var(--primary-dark);
}

.btn-reorder:disabled {
    background: #B0BEC5;
    cursor: not-allowed;
}

.preview-hint {
    font-size: 0.9rem;
    color: var(--text-light);
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border-left: 4px solid var(--primary-color);
}

.preview-hint strong {
    color: var(--primary-dark);
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }

    .modules-panel {
        flex: none;
        max-height: none;
    }

    .modules-grid {
        flex-direction: column;
    }

    .category-section {
        width: 100%;
    }

    .module-card {
        flex: 1 1 100%;
        min-width: auto;
    }
}

@media (max-width: 600px) {
    header {
        padding: 20px 16px;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .app-container {
        padding: 16px;
    }

    .module-card {
        flex: 1 1 100%;
    }

    .info-panel {
        flex-direction: column;
    }
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ============================================
   DESIGN SYSTEM UTILITIES (PHASE 2)
   ============================================ */

/* Typography Utils */
.h1-title {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-bold);
    font-size: 2rem;
    color: var(--color-primary);
}

.h2-title {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-medium);
    /* Semi-bold */
    font-size: 1.5rem;
    color: var(--color-primary);
}

/* Button Component */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-medium);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: #1B1D33;
    color: #F9F8F4;
    border: 1px solid rgba(249, 248, 244, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: rgba(27, 29, 51, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 29, 51, 0.4);
}

.btn-secondary {
    background-color: #1B1D33;
    border: 1px solid rgba(249, 248, 244, 0.2);
    color: #F9F8F4;
}

.btn-secondary:hover {
    background-color: rgba(27, 29, 51, 0.9);
    box-shadow: 0 4px 12px rgba(27, 29, 51, 0.3);
}

/* Input Component */
.input-text {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #CCCCCC;
    border-radius: var(--radius-sm);
    font-family: var(--font-family-base);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-text:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 84, 135, 0.1);
}

/* Card Component (Generic) */
.card {
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Helper Classes */
.text-primary {
    color: var(--color-primary);
}

.text-accent {
    color: var(--color-accent);
}

.bg-secondary {
    background-color: var(--color-secondary);
}

/* Panel Header Styles */
.panel-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-border);
}

.panel-header h2 {
    margin-bottom: 4px;
    /* Tighten spacing with subtitle */
}

.panel-subtitle {
    font-family: var(--font-family-base);
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: var(--font-weight-regular);
}

/* Tabbed Interface Styles */
.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 16px;
    gap: 16px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 4px;
    font-family: var(--font-family-base);
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
    color: var(--text-light);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--color-primary);
}

.tab-btn.active {
    color: var(--color-primary);
    font-weight: var(--font-weight-bold);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-cta);
    /* Lime underline */
}

/* Tab Switching Logic */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block !important;
}

/* Colors grid for sidebar */
.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
}

.empty-state-tab {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    background-color: var(--color-surface-dim);
    border-radius: var(--radius-md);
    border: 1px dashed var(--color-border);
}

/* Premium 2D Visualization (Task 2.3) */
.preview-container {
    background-color: #ffffff;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    /* Technical Grid */
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.02),
        0 4px 12px rgba(0, 0, 0, 0.05);
    /* Soft outer shadow */
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* "Technical Drawing" Label Badge */
.preview-container::before {
    content: 'VUE TECHNIQUE 2D';
    position: absolute;
    top: 16px;
    left: 16px;
    font-family: var(--font-family-base);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-light);
    opacity: 0.6;
    pointer-events: none;
    border: 1px solid var(--color-border);
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

/* 3D View Label */
#casier-3d-container::before,
#casier-3d-color-container::before {
    content: 'VUE 3D';
    position: absolute;
    top: 16px;
    left: 16px;
    font-family: var(--font-family-base);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
    opacity: 0.8;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* ============================================
   INTERACTIONS & STATES (Task 2.4 & 2.5)
   ============================================ */

/* Micro-interactions: Module Card Lift */
.module-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Smooth spring-like ease */
}

.module-card:hover {
    transform: translateY(-4px);
    /* Shadows are handled by specific modifiers, adding a base lift here */
}

/* Micro-interactions: Button Press */
.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* Visual States: Disabled */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #e0e0e0 !important;
    color: #a0a0a0 !important;
    box-shadow: none !important;
    transform: none !important;
    border-color: transparent !important;
}

/* Visual States: Focus Accessibility */
*:focus-visible {
    outline: 2px solid var(--color-cta);
    outline-offset: 2px;
}

/* Tab Transitions */
.tab-btn {
    transition: color 0.2s, background-color 0.2s;
}