/* Éviter débordements et scroll horizontal */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    overflow-x: hidden;
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body { 
    background-color: #FDFDFC; 
    min-height: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

/* intl-tel-input Custom Styles */
.iti {
    width: 100%;
}

.iti__flag-container {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    margin: auto;
    padding: 0 8px;
}

.iti__selected-flag {
    z-index: 4;
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 6px 0 8px;
}

.iti__selected-flag:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.iti__arrow {
    margin-left: 6px;
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 4px solid #555;
}

.iti__country-list {
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.iti__country {
    padding: 5px 10px;
    cursor: pointer;
}

.iti__country:hover {
    background-color: #f0f0f0;
}

.iti__country.iti__highlight {
    background-color: #e0e0e0;
}

/* Adjust input padding when intl-tel-input is active */
.form-group input[type="tel"] {
    padding-left: 52px;
}

.iti.has-error {
    border: 1px solid #ef4444;
    border-radius: 6px;
}

.iti.has-error input {
    border-color: #ef4444;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.welcome-content {
    text-align: center;
    color: white;
    max-width: 600px;
    animation: fadeInUp 0.8s ease;
}

.logo-container {
    margin-bottom: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

.logo-image {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.welcome-title {
    font-size: 4rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.1em;
}

.welcome-subtitle {
    font-size: 1.75rem;
    font-weight: 500;
    margin: 1rem 0;
    opacity: 0.95;
}

.welcome-description {
    font-size: 1.125rem;
    line-height: 1.8;
    margin: 2rem 0 3rem;
    opacity: 0.9;
}

.btn-commander {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #667eea;
    background: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-commander::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-commander:hover::before {
    width: 300px;
    height: 300px;
}

.btn-commander:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-commander:active {
    transform: translateY(0);
}

.btn-commander svg {
    transition: transform 0.3s ease;
}

.btn-commander:hover svg {
    transform: translateX(5px);
}

/* Form Wrapper */
.form-wrapper {
    padding: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.btn-back-home {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #667eea;
    background: white;
    border: 2px solid #667eea;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    z-index: 1000;
}

.btn-back-home:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-back-home:active {
    transform: translateY(0);
}

.btn-back-home svg {
    transition: transform 0.3s ease;
}

.btn-back-home:hover svg {
    transform: translateX(-3px);
}

/* Error and Success Containers */
.error-container {
    background: #fee;
    border: 1px solid #f53003;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

.error-container h3 {
    color: #f53003;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.error-container ul {
    list-style: disc;
    margin-left: 1.5rem;
    margin: 0.5rem 0 0 1.5rem;
}

.success-container {
    background: #f0fdf4;
    border: 1px solid #22c55e;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

.success-container p {
    color: #22c55e;
    margin: 0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.container { 
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    padding: 1rem 1rem 0 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.header { 
    margin-bottom: 1rem; 
    margin-top: 0.5rem;
    text-align: center; 
}

.header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.header p {
    font-size: 0.875rem;
    color: #6b7280;
}

.form-container { 
    background: white; 
    border-radius: 0.75rem; 
    padding: 0;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1); 
    max-width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.form-content-wrapper {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Layout formulaire : sidebar (stepper) + contenu principal */
.form-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.form-sidebar {
    flex-shrink: 0;
    width: 100%;
}

.form-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.section { 
    margin-bottom: 0.75rem; 
}

.section-title { 
    font-size: 1rem; 
    font-weight: 600; 
    color: #1b1b18; 
    margin-bottom: 1rem; 
    padding-bottom: 0.25rem; 
    border-bottom: 2px solid #9267b7; 
}

.form-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 1rem; 
}

@media (min-width: 640px) { 
    .form-grid { 
        grid-template-columns: repeat(2, 1fr); 
    } 
}

/* ========== Téléphone (max-width: 639px) : responsivité et pas de scroll horizontal ========== */
@media (max-width: 639px) {
    html {
        overflow-x: hidden !important;
        max-width: 100%;
        width: 100%;
    }
    body {
        overflow-x: hidden !important;
        max-width: 100%;
        width: 100%;
    }
    .welcome-screen {
        overflow-x: hidden !important;
        max-width: 100%;
        width: 100%;
    }

    /* Bloquer tout scroll horizontal dans le formulaire */
    .form-wrapper {
        overflow-x: hidden !important;
    }

    /* Un seul scroll (body) sur mobile : bloquer seulement quand le popup récap est ouvert */
    body.recap-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
    }

    .welcome-title {
        font-size: 2.5rem;
    }
    
    .welcome-subtitle {
        font-size: 1.25rem;
    }
    
    .welcome-description {
        font-size: 1rem;
    }

    /* Formulaire dans le flux : un seul scroll pour tout le body */
    .form-wrapper {
        position: relative;
        width: 100%;
        max-width: 100%;
        min-height: 100dvh;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }
    
    .container {
        padding: 0.5rem;
        padding-top: 4rem;
        max-width: 100%;
        width: 100%;
        overflow-x: hidden !important;
        min-height: auto;
    }
    
    .form-container {
        padding: 1rem;
        overflow-x: hidden !important;
        max-width: 100%;
        min-width: 0;
        min-height: auto;
    }

    .form-layout {
        overflow-x: hidden !important;
        min-width: 0;
        min-height: auto;
    }

    .form-main {
        min-width: 0;
        overflow-x: hidden !important;
        min-height: auto;
    }

    .form-content-wrapper {
        overflow-x: hidden !important;
        min-height: auto;
    }

    /* Pas de scroll interne : tout défile avec le body */
    .step-content,
    .step-content.active {
        overflow-x: hidden !important;
        overflow-y: visible;
    }
    
    .stepper-container {
        padding: 0.4rem 0.5rem;
    }
    
    .stepper {
        padding: 0.15rem 0;
    }
    
    .step-circle {
        width: 28px;
        height: 28px;
        font-size: 0.6875rem;
        border-width: 2px;
    }
    
    .step-checkmark {
        width: 14px;
        height: 14px;
    }
    
    .step-label {
        font-size: 0.625rem;
        margin-top: 0.3rem;
    }
    
    .step.active .step-label {
        font-size: 0.6875rem;
    }
    
    .step-line {
        margin: 0 0.2rem;
        top: -14px;
        height: 2px;
    }
    
    .progress-bar {
        margin-top: 0.4rem;
        height: 2px;
        margin-top: 0.75rem;
    }
    
    .btn-back-home {
        top: 1rem;
        right: 1rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .btn-back-home span {
        display: none;
    }
    
    .btn-back-home svg {
        margin: 0;
    }
    
    .step-navigation {
        flex-direction: column-reverse;
        gap: 0.75rem;
        padding: 0.2rem;
    }
    
    .step-navigation .btn-primary,
    .step-navigation .btn-secondary {
        width: 100%;
        min-width: unset;
        margin-left: 0;
    }
    
    .step-navigation {
        padding: 1rem;
    }

    /* Téléphone : éviter tout scroll horizontal */
    .form-wrapper img,
    .form-wrapper video,
    .form-wrapper iframe {
        max-width: 100%;
        height: auto;
    }
    .form-wrapper input,
    .form-wrapper select,
    .form-wrapper textarea,
    .form-wrapper button {
        max-width: 100%;
    }
    .form-wrapper .section,
    .form-wrapper .form-grid,
    .form-wrapper .structure-type-buttons,
    .form-wrapper .command-type-cards,
    .form-wrapper .confirmation-wrapper {
        max-width: 100%;
        overflow-x: hidden !important;
    }
    .structure-search-wrapper {
        min-width: 0;
        overflow-x: hidden;
    }
    .structure-type-buttons {
        flex-wrap: wrap;
    }
    .structure-type-btn {
        min-width: 0;
    }
    .form-wrapper table {
        table-layout: fixed;
        width: 100%;
        max-width: 100%;
    }
    .form-wrapper td,
    .form-wrapper th {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    /* Textes longs : casser pour éviter débordement */
    .form-wrapper .section-title,
    .form-wrapper label,
    .form-wrapper p,
    .form-wrapper .card-title,
    .form-wrapper .card-subtitle {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

.form-group { 
    display: flex; 
    flex-direction: column; 
    gap: 0.5rem; 
}

.form-group.full-width { 
    grid-column: 1 / -1; 
}

label { 
    font-size: 0.875rem; 
    font-weight: 500; 
    color: #1b1b18; 
}

input, textarea { 
    padding: 0.625rem 0.875rem; 
    border: 1px solid #e3e3e0; 
    border-radius: 0.375rem; 
    font-size: 0.9375rem; 
    transition: all 0.15s ease; 
    background: white; 
}

input:focus, textarea:focus { 
    outline: none; 
    border-color: #f53003; 
    box-shadow: 0 0 0 3px rgba(245, 48, 3, 0.1); 
}

textarea { 
    resize: vertical; 
    min-height: 80px; 
    font-family: inherit;
}

.required::after { 
    content: " *"; 
    color: #f53003; 
}

.button-group { 
    display: flex !important; 
    gap: 0.75rem; 
    justify-content: flex-end; 
    margin-top: 0; 
    padding-top: 0; 
    border-top: none; 
    visibility: visible !important;
}

.button-group button {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.button-group button[style*="display: none"] {
    display: none !important;
}

button { 
    padding: 0.75rem 2rem; 
    font-size: 0.875rem; 
    font-weight: 500; 
    border-radius: 0.375rem; 
    cursor: pointer; 
    transition: all 0.15s ease; 
    border: 1px solid transparent;
    visibility: visible !important;
    opacity: 1 !important;
}

.btn-primary { 
    background: #1b1b18; 
    color: white; 
    border-color: #1b1b18;
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-block !important;
}

.btn-primary:hover { 
    background: black; 
    border-color: black; 
}

.btn-secondary { 
    background: transparent; 
    color: #1b1b18; 
    border-color: #19140035;
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-block !important;
}

.btn-secondary:hover { 
    border-color: #1915014a; 
}

.radio-group, .checkbox-group { 
    display: flex; 
    gap: 1.5rem; 
    flex-wrap: wrap; 
}

.radio-label, .checkbox-label { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
    cursor: pointer; 
    font-weight: 400; 
}

input[type="radio"], input[type="checkbox"] { 
    width: 1.25rem; 
    height: 1.25rem; 
    cursor: pointer; 
    accent-color: #f53003; 
}

.materiel-section { 
    margin-top: 0.75rem; 
    padding: 0.75rem; 
    background: #f9f9f9; 
    border-radius: 0.5rem; 
    border: 1px solid #e3e3e0; 
}

.subsection-title { 
    font-size: 0.9375rem; 
    font-weight: 600; 
    color: #1b1b18; 
    margin-bottom: 0.5rem; 
}

.materiel-list { 
    display: flex; 
    flex-direction: column; 
    gap: 0.75rem; 
}

.materiel-item { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 0.75rem; 
    padding: 0.75rem; 
    background: white; 
    border: 1px solid #e3e3e0; 
    border-radius: 0.375rem; 
}

.quantity-input { 
    width: 120px; 
    padding: 0.5rem 0.75rem; 
}

.license-quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.license-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #9267b7 0%, #764ba2 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(146, 103, 183, 0.2);
    cursor: help;
    transition: all 0.2s ease;
}

.license-badge:hover {
    background: linear-gradient(135deg, #764ba2 0%, #5a3a7a 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(146, 103, 183, 0.3);
}

/* License Section Enhanced */
.license-section-enhanced {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 2px solid #e8eaff;
    box-shadow: 0 2px 8px rgba(146, 103, 183, 0.08);
}

.license-item {
    background: white;
    border: 1px solid #e8eaff;
    transition: all 0.3s ease;
}

.license-item:hover {
    border-color: #9267b7;
    box-shadow: 0 2px 8px rgba(146, 103, 183, 0.1);
    transform: translateY(-1px);
}

.license-item:has(.license-checkbox:checked) {
    background: linear-gradient(135deg, #fff5ff 0%, #fef0ff 100%);
    border-color: #9267b7;
    box-shadow: 0 2px 12px rgba(146, 103, 183, 0.15);
}

/* License Info Box */
.license-info-box {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fff9e6 0%, #fff5d6 100%);
    border-left: 4px solid #f59e0b;
    border-radius: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.1);
}

.license-info-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #fef3c7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    margin-top: 2px;
}

.license-info-content {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #92400e;
}

.license-info-content strong {
    color: #78350f;
    font-weight: 600;
}

@media (max-width: 640px) {
    .license-info-box {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .license-info-icon {
        width: 28px;
        height: 28px;
    }
    
    .license-info-content {
        font-size: 0.8125rem;
    }
}

.hidden { 
    display: none !important; 
}

.error-message { 
    color: #f53003; 
    font-size: 0.875rem; 
    margin-top: 0.25rem; 
}

.has-error { 
    border-color: #f53003 !important; 
}

.field-required { 
    border-color: #f53003; 
    background-color: #fff5f5; 
}

/* Stepper Styles - Redesigned */
.stepper-container {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    border: 1px solid #e3e3e0;
}

/* Sidebar stepper : conteneur pour version verticale sur desktop */
.stepper-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.stepper-sidebar .progress-bar {
    margin-top: auto;
    flex-shrink: 0;
}

.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    padding: 0.25rem 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateY(-2px);
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e3e3e0;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e3e3e0;
    position: relative;
    overflow: hidden;
}

.step-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(146, 103, 183, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.step.active .step-circle::before {
    width: 100%;
    height: 100%;
}

.step-number {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.step-checkmark {
    position: absolute;
    width: 16px;
    height: 16px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2;
    color: white;
}

.step.active .step-circle {
    background: linear-gradient(135deg, #9267b7 0%, #764ba2 100%);
    color: white;
    border-color: #9267b7;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(146, 103, 183, 0.3);
    animation: pulseActive 2s ease-in-out infinite;
}

.step.active .step-number {
    color: white;
}

.step.completed .step-circle {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border-color: #22c55e;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.step.completed .step-number {
    opacity: 0;
    transform: scale(0);
}

.step.completed .step-checkmark {
    opacity: 1;
    transform: scale(1);
}

.step-label {
    margin-top: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #9ca3af;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.step.active .step-label {
    color: #9267b7;
    font-weight: 700;
    font-size: 0.75rem;
    transform: scale(1.05);
}

.step.completed .step-label {
    color: #22c55e;
    font-weight: 600;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #e3e3e0;
    margin: 0 0.375rem;
    position: relative;
    top: -16px;
    border-radius: 2px;
    overflow: hidden;
    z-index: 1;
}

.step-line-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.step.completed .step-line-fill {
    width: 100%;
}

.step.active ~ .step .step-line-fill {
    width: 0;
}

.step.completed ~ .step-line .step-line-fill {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 3px;
    background: #e3e3e0;
    border-radius: 10px;
    margin-top: 0.5rem;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #9267b7 0%, #764ba2 50%, #22c55e 100%);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 25%;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes pulseActive {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(146, 103, 183, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(146, 103, 183, 0.6);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Step Content */
.step-content {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    margin-right: -0.5rem;
}

.step-content.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.step-content::-webkit-scrollbar {
    width: 6px;
}

.step-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.step-content::-webkit-scrollbar-thumb {
    background: #9267b7;
    border-radius: 10px;
}

.step-content::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step Navigation - collé en bas, pas d'espace ni margin après */
.step-navigation {
    margin: 0;
    margin-top: auto;
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    border-top: 1px solid #e3e3e0;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    background: white;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1000;
    flex-shrink: 0;
    min-height: 60px;
    order: 999;
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.05);
    background: linear-gradient(to top, #ffffff 0%, #fafafa 100%);
}

.step-navigation .btn-primary,
.step-navigation .btn-secondary {
    min-width: 120px;
    flex-shrink: 0;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto;
    min-height: 40px;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 101;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.step-navigation button[style*="display: none"] {
    display: none !important;
}

.step-navigation #nextBtn {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 102 !important;
}

.step-navigation #submitBtn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
}

.step-navigation #submitBtn:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.step-navigation #submitBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
}

.step-navigation #submitBtn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Force visibility of navigation buttons */
#stepNavigation {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#stepNavigation button:not([style*="display: none"]) {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.step-navigation .btn-primary:not(#submitBtn) {
    margin-left: auto;
    background: linear-gradient(135deg, #9267b7 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.step-navigation .btn-primary:not(#submitBtn):hover {
    background: linear-gradient(135deg, #764ba2 0%, #5a3a7a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(146, 103, 183, 0.4);
}

.step-navigation .btn-primary:not(#submitBtn):active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(146, 103, 183, 0.3);
}

.step-navigation .btn-secondary {
    background: white;
    color: #9267b7;
    border: 2px solid #9267b7;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.step-navigation .btn-secondary:hover {
    background: #9267b7;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(146, 103, 183, 0.3);
}

.step-navigation .btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(146, 103, 183, 0.2);
}

/* Confirmation Summary */
/* Confirmation Wrapper */
.confirmation-wrapper {
    margin-top: 1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.08);
}

.confirmation-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #bae6fd;
}

.confirmation-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.confirmation-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0c4a6e;
    margin: 0;
}

.confirmation-summary {
    margin-top: 0;
}

.summary-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: #0c4a6e;
    font-size: 0.9375rem;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #bae6fd;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.summary-section {
    background: white;
    border: 1px solid #bae6fd;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(14, 165, 233, 0.05);
    transition: all 0.3s ease;
}

.summary-section:hover {
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
    transform: translateY(-1px);
}

.summary-section:last-child {
    margin-bottom: 0;
}

.summary-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #0ea5e9;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #bae6fd;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border-radius: 2px;
}

.summary-section p {
    margin: 0.5rem 0;
    font-size: 0.9375rem;
    color: #1b1b18;
    line-height: 1.7;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.summary-section p::before {
    content: '•';
    color: #0ea5e9;
    font-weight: bold;
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 0.125rem;
}

.summary-section strong {
    color: #0c4a6e;
    font-weight: 600;
    min-width: 120px;
    display: inline-block;
}

/* Price Summary Section */
.summary-price-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1);
}

.summary-price-section h3 {
    color: #16a34a;
    border-bottom-color: #86efac;
}

.summary-price-section h3::before {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.summary-price-section p {
    color: #166534;
}

.summary-price-section p strong {
    color: #15803d;
}

/* Note Client Section */
.note-client-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fef3f2 0%, #fee2e2 100%);
    border: 2px solid #fecaca;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.08);
}

.note-client-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.note-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.3);
}

.note-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #991b1b;
    margin: 0;
    cursor: text;
}

.optional-badge {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #dc2626;
    background: #fee2e2;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #fecaca;
}

.note-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #fecaca;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-family: inherit;
    line-height: 1.6;
    color: #1b1b18;
    background: white;
    transition: all 0.2s ease;
    resize: vertical;
    min-height: 100px;
}

.note-textarea:focus {
    outline: none;
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
    background: #fff;
}

.note-textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.note-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #fff5f5;
    border-radius: 0.5rem;
    border: 1px solid #fecaca;
    font-size: 0.8125rem;
    color: #991b1b;
    line-height: 1.5;
}

.note-hint svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #f87171;
}

@media (max-width: 640px) {
    .confirmation-wrapper {
        padding: 1rem;
    }
    
    .confirmation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .summary-section p {
        flex-direction: column;
        gap: 0.25rem;
    }

    /* Recap popup : label et valeur sur la même ligne */
    .recap-popup-body .summary-section p {
        flex-direction: row !important;
        flex-wrap: nowrap;
        gap: 0.35rem;
    }
    .recap-popup-body .summary-section strong {
        min-width: 6em;
        flex-shrink: 0;
    }
    
    .summary-section strong {
        min-width: auto;
    }
    
    .note-client-section {
        padding: 1rem;
    }
    
    .note-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

.sets {
    margin-top: 0.5rem;
    padding: 1rem;
    background: #f9f9f9;
    border: 1px solid #e3e3e0;
    border-radius: 0.5rem;
}

/* Footer */
.main-footer {
    margin-top: 0.5rem;
    padding: 1rem;
    border-top: 1px solid #e3e3e0;
    text-align: center;
    background: white;
    display: none;
}

.main-footer p {
    color: #6b7280;
    font-size: 0.8125rem;
    margin: 0;
}

@media (prefers-color-scheme: dark) {
    body { 
        background-color: #0a0a0a; 
        color: #EDEDEC; 
    }
    
    .form-container { 
        background: #161615; 
    }
    
    .section-title { 
        color: #EDEDEC; 
        border-bottom-color: #FF4433; 
    }
    
    label { 
        color: #EDEDEC; 
    }
    
    input, textarea { 
        background: #161615; 
        border-color: #3E3E3A; 
        color: #EDEDEC; 
    }
    
    input:focus, textarea:focus { 
        border-color: #FF4433; 
        box-shadow: 0 0 0 3px rgba(255, 68, 51, 0.1); 
    }
    
    .required::after { 
        color: #FF4433; 
    }
    
    .button-group { 
        border-top-color: #3E3E3A; 
    }
    
    .btn-primary { 
        background: #eeeeec; 
        color: #1C1C1A; 
        border-color: #eeeeec; 
    }
    
    .btn-primary:hover { 
        background: white; 
        border-color: white; 
    }
    
    .btn-secondary { 
        color: #EDEDEC; 
        border-color: #3E3E3A; 
    }
    
    .btn-secondary:hover { 
        border-color: #62605b; 
    }
    
    input[type="radio"], input[type="checkbox"] { 
        accent-color: #FF4433; 
    }
    
    .materiel-section { 
        background: #0a0a0a; 
        border-color: #3E3E3A; 
    }
    
    .license-section-enhanced {
        background: linear-gradient(135deg, #1a1a1a 0%, #161515 100%);
        border-color: #3E3E3A;
    }
    
    .license-item {
        background: #161615;
        border-color: #3E3E3A;
    }
    
    .license-item:hover {
        border-color: #FF4433;
    }
    
    .license-item:has(.license-checkbox:checked) {
        background: linear-gradient(135deg, #2a1a1a 0%, #1a0a0a 100%);
        border-color: #FF4433;
    }
    
    .license-info-box {
        background: linear-gradient(135deg, #2a1a0a 0%, #1a0a0a 100%);
        border-left-color: #f59e0b;
    }
    
    .license-info-icon {
        background: #3a2a0a;
        color: #f59e0b;
    }
    
    .license-info-content {
        color: #fbbf24;
    }
    
    .license-info-content strong {
        color: #fcd34d;
    }
    
    .subsection-title { 
        color: #EDEDEC; 
    }
    
    .materiel-item { 
        background: #161615; 
        border-color: #3E3E3A; 
    }
    
    .error-message {
        color: #FF4433;
    }
    
    .has-error { 
        border-color: #FF4433 !important; 
    }
    
    .field-required { 
        border-color: #FF4433; 
        background-color: #2a0f0f; 
    }

    /* Welcome Screen Dark Mode */
    .welcome-screen {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }

    .btn-commander {
        color: #1a1a2e;
    }

    .btn-commander:hover::before {
        background: rgba(255, 255, 255, 0.1);
    }

    /* Stepper Dark Mode */
    .stepper-container {
        background: linear-gradient(135deg, #161615 0%, #1a1a1a 100%);
        border-color: #3E3E3A;
    }

    .form-sidebar {
        background: linear-gradient(180deg, #1a1a1a 0%, #161615 100%);
        border-right-color: #3E3E3A;
    }

    .form-sidebar .stepper-container.stepper-sidebar {
        background: transparent;
    }

    .step-circle {
        background: #3E3E3A;
        color: #EDEDEC;
        border-color: #3E3E3A;
    }

    .step.active .step-circle {
        background: linear-gradient(135deg, #FF4433 0%, #cc3526 100%);
        border-color: #FF4433;
        box-shadow: 0 4px 12px rgba(255, 68, 51, 0.4);
    }

    .step.active .step-circle::before {
        background: rgba(255, 68, 51, 0.2);
    }

    .step.completed .step-circle {
        background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
        border-color: #22c55e;
        box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    }

    .step-label {
        color: #9ca3af;
    }

    .step.active .step-label {
        color: #FF4433;
    }

    .step.completed .step-label {
        color: #22c55e;
    }

    .step-line {
        background: #3E3E3A;
    }

    .step-line-fill {
        background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    }

    .progress-bar {
        background: #3E3E3A;
    }

    .progress-fill {
        background: linear-gradient(90deg, #FF4433 0%, #cc3526 50%, #22c55e 100%);
    }

    .step-navigation {
        border-top-color: #3E3E3A;
        background: #161615;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    }
    
    .step-navigation .btn-primary:not(#submitBtn) {
        background: linear-gradient(135deg, #FF4433 0%, #cc3526 100%);
    }
    
    .step-navigation .btn-primary:not(#submitBtn):hover {
        background: linear-gradient(135deg, #cc3526 0%, #99261c 100%);
    }
    
    .step-navigation .btn-secondary {
        background: #161615;
        color: #FF4433;
        border-color: #FF4433;
    }
    
    .step-navigation .btn-secondary:hover {
        background: #FF4433;
        color: white;
    }
    
    .step-navigation #submitBtn {
        background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    }
    
    .step-navigation #submitBtn:hover {
        background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    }
    
    .command-type-card {
        background: #161615;
        border-color: #3E3E3A;
    }
    
    .command-type-card:hover {
        border-color: #FF4433;
    }
    
    .command-type-card:has(input[type="radio"]:checked) {
        background: linear-gradient(135deg, #2a1a1a 0%, #1a0a0a 100%);
        border-color: #FF4433;
    }
    
    .card-title {
        color: #EDEDEC;
    }
    
    .command-type-card:has(input[type="radio"]:checked) .card-title {
        color: #FF4433;
    }
    
    .card-subtitle {
        color: #9ca3af;
    }
    
    .command-type-card:has(input[type="radio"]:checked) .card-subtitle {
        color: #f87171;
    }
    
    .kit-section-card {
        background: linear-gradient(135deg, #0a1a2a 0%, #0a1520 100%);
        border-color: #1e3a5f;
    }
    
    .kit-header {
        border-bottom-color: #1e3a5f;
    }
    
    .kit-materiels-list {
        background: #161615;
        border-color: #1e3a5f;
    }
    
    .kit-materiel-item {
        color: #93c5fd;
    }
    
    .kit-materiel-item svg {
        color: #60a5fa;
    }
    
    .kit-quantity-group {
        border-top-color: #1e3a5f;
    }
    
    .kit-quantity-input {
        background: #161615;
        border-color: #1e3a5f;
        color: #EDEDEC;
    }
    
    .kit-quantity-input:focus {
        border-color: #60a5fa;
    }
    
    .single-section-enhanced {
        background: linear-gradient(135deg, #2a1a1a 0%, #1a0a0a 100%);
        border-color: #3E3E3A;
    }
    
    .single-section-header {
        border-bottom-color: #3E3E3A;
    }
    
    .section-badge {
        background: #2a0a0a;
        border-color: #3E3E3A;
        color: #fbbf24;
    }
    
    .single-materiel-item {
        background: #161615;
        border-color: #3E3E3A;
    }
    
    .single-materiel-item:hover {
        border-color: #FF4433;
    }
    
    .single-materiel-item:has(.single-materiel-checkbox:checked) {
        background: linear-gradient(135deg, #3a1a1a 0%, #2a0a0a 100%);
        border-color: #FF4433;
    }
    
    .materiel-name {
        color: #EDEDEC;
    }
    
    .materiel-price {
        color: #f87171;
    }
    
    .single-quantity-input {
        background: #161615;
        border-color: #3E3E3A;
        color: #EDEDEC;
    }
    
    .single-quantity-input:focus {
        border-color: #FF4433;
    }
    
    .confirmation-wrapper {
        background: linear-gradient(135deg, #0a1a2a 0%, #0a1520 100%);
        border-color: #1e3a5f;
    }
    
    .confirmation-header {
        border-bottom-color: #1e3a5f;
    }
    
    .confirmation-title {
        color: #93c5fd;
    }
    
    .summary-loading {
        color: #93c5fd;
    }
    
    .loading-spinner {
        border-color: #1e3a5f;
        border-top-color: #60a5fa;
    }
    
    .summary-section {
        background: #161615;
        border-color: #1e3a5f;
    }
    
    .summary-section:hover {
        border-color: #3b82f6;
    }
    
    .summary-section h3 {
        color: #60a5fa;
        border-bottom-color: #1e3a5f;
    }
    
    .summary-section h3::before {
        background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    }
    
    .summary-section p {
        color: #e5e7eb;
    }
    
    .summary-section p::before {
        color: #60a5fa;
    }
    
    .summary-section strong {
        color: #93c5fd;
    }
    
    .summary-price-section {
        background: linear-gradient(135deg, #0a2a0a 0%, #051a05 100%);
        border-color: #1e3a1e;
    }
    
    .summary-price-section h3 {
        color: #4ade80;
        border-bottom-color: #1e3a1e;
    }
    
    .summary-price-section h3::before {
        background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    }
    
    .summary-price-section p {
        color: #86efac;
    }
    
    .summary-price-section p strong {
        color: #4ade80;
    }
    
    .note-client-section {
        background: linear-gradient(135deg, #2a1a1a 0%, #1a0a0a 100%);
        border-color: #3E3E3A;
    }
    
    .note-label {
        color: #fbbf24;
    }
    
    .optional-badge {
        background: #2a0a0a;
        border-color: #3E3E3A;
        color: #fbbf24;
    }
    
    .note-textarea {
        background: #161615;
        border-color: #3E3E3A;
        color: #EDEDEC;
    }
    
    .note-textarea:focus {
        border-color: #FF4433;
        background: #1a1a1a;
    }
    
    .note-textarea::placeholder {
        color: #6b7280;
    }
    
    .note-hint {
        background: #2a0a0a;
        border-color: #3E3E3A;
        color: #fbbf24;
    }
    
    .note-hint svg {
        color: #f87171;
    }
    
    .btn-back-home {
        background: #161615;
        border-color: #3E3E3A;
        color: #EDEDEC;
    }
    
    .btn-back-home:hover {
        background: #FF4433;
        border-color: #FF4433;
        color: white;
    }
}

/* Structure Type Buttons */
.structure-type-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.structure-type-btn {
    flex: 1;
    min-width: 200px;
    padding: 1.25rem 1.5rem;
    background: white;
    border: 2px solid #e3e3e0;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.structure-type-btn:hover {
    border-color: #9267b7;
    color: #9267b7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(146, 103, 183, 0.15);
}

.structure-type-btn.active {
    background: linear-gradient(135deg, #9267b7 0%, #764ba2 100%);
    border-color: #9267b7;
    color: white;
    box-shadow: 0 4px 12px rgba(146, 103, 183, 0.3);
}

.structure-type-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(146, 103, 183, 0.4);
}

.structure-type-btn svg {
    flex-shrink: 0;
    stroke: currentColor;
}

/* Structure Search */
.structure-search-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.structure-search-wrapper input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e3e3e0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.structure-search-wrapper input:focus {
    outline: none;
    border-color: #9267b7;
    box-shadow: 0 0 0 3px rgba(146, 103, 183, 0.1);
}

.btn-search-structure {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #9267b7 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(146, 103, 183, 0.2);
}

.btn-search-structure:hover:not(:disabled) {
    background: linear-gradient(135deg, #764ba2 0%, #5a3a7a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(146, 103, 183, 0.3);
}

.btn-search-structure:active:not(:disabled) {
    transform: translateY(0);
}

.btn-search-structure:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-search-structure svg.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.structure-search-message {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
}

.structure-search-message.success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.structure-search-message.error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.structure-search-message .success-icon,
.structure-search-message .error-icon {
    font-size: 1.125rem;
    font-weight: bold;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .structure-type-buttons {
        flex-direction: column;
    }

    .structure-type-btn {
        min-width: 100%;
    }

    .structure-search-wrapper {
        flex-direction: column;
    }

    .btn-search-structure {
        width: 100%;
        justify-content: center;
    }
}

/* Command Type Cards */
.command-type-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.command-type-card {
    position: relative;
    cursor: pointer;
    border: 2px solid #e3e3e0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    background: white;
    transition: all 0.3s ease;
    overflow: hidden;
}

.command-type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(146, 103, 183, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.command-type-card:hover {
    border-color: #9267b7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(146, 103, 183, 0.15);
}

.command-type-card:hover::before {
    opacity: 1;
}

.command-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.command-type-card input[type="radio"]:checked + .card-content {
    color: #9267b7;
}

.command-type-card:has(input[type="radio"]:checked) {
    border-color: #9267b7;
    background: linear-gradient(135deg, #fff5ff 0%, #fef0ff 100%);
    box-shadow: 0 4px 16px rgba(146, 103, 183, 0.2);
}

.command-type-card:has(input[type="radio"]:checked)::before {
    opacity: 1;
}

.card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #9267b7 0%, #764ba2 100%);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.command-type-card:has(input[type="radio"]:checked) .card-icon {
    background: linear-gradient(135deg, #764ba2 0%, #5a3a7a 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(146, 103, 183, 0.3);
}

.card-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1b1b18;
    transition: color 0.3s ease;
}

.command-type-card:has(input[type="radio"]:checked) .card-title {
    color: #9267b7;
}

.card-subtitle {
    font-size: 0.8125rem;
    color: #6b7280;
    transition: color 0.3s ease;
}

.command-type-card:has(input[type="radio"]:checked) .card-subtitle {
    color: #764ba2;
}

/* Kit Section Cards */
.kit-section-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    margin-top: 1rem;
}

.kit-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #bae6fd;
}

.kit-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.kit-materiels-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e0f2fe;
}

.kit-materiel-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    color: #0c4a6e;
    font-size: 0.875rem;
}

.kit-materiel-item svg {
    color: #0ea5e9;
    flex-shrink: 0;
}

.kit-quantity-group {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #bae6fd;
}

.kit-quantity-input {
    width: 100%;
    max-width: 200px;
    padding: 0.625rem 0.875rem;
    border: 2px solid #bae6fd;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.kit-quantity-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Single Section Enhanced */
.single-section-enhanced {
    background: linear-gradient(135deg, #fef3f2 0%, #fee2e2 100%);
    border: 2px solid #fecaca;
}

.single-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #fecaca;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.section-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #991b1b;
    background: #fee2e2;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #fecaca;
}

.single-materiel-item {
    background: white;
    border: 1px solid #fecaca;
    transition: all 0.3s ease;
}

.single-materiel-item:hover {
    border-color: #f87171;
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.1);
    transform: translateY(-1px);
}

.single-materiel-item:has(.single-materiel-checkbox:checked) {
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    border-color: #f87171;
    box-shadow: 0 2px 12px rgba(248, 113, 113, 0.15);
}

.materiel-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.materiel-name {
    font-weight: 600;
    color: #1b1b18;
    font-size: 0.9375rem;
}

.materiel-price {
    font-size: 0.8125rem;
    color: #dc2626;
    font-weight: 600;
}

.single-materiel-item:has(.single-materiel-checkbox:checked) .materiel-price {
    color: #991b1b;
}

.single-quantity-input {
    width: 100px;
    padding: 0.5rem 0.75rem;
    border: 2px solid #fecaca;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.single-quantity-input:focus {
    outline: none;
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

.single-materiel-item:has(.single-materiel-checkbox:checked) .single-quantity-input {
    border-color: #f87171;
    background: white;
}

@media (max-width: 640px) {
    .command-type-cards {
        grid-template-columns: 1fr;
    }
    
    .card-content {
        gap: 0.75rem;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
    }
    
    .single-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .single-materiel-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .single-quantity-input {
        width: 100%;
    }
}

/* ========== Responsive: all screen types ========== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-width: 280px;
}

/* Safe area for notched / rounded devices */
.btn-back-home {
    top: max(1.5rem, env(safe-area-inset-top));
    right: max(1.5rem, env(safe-area-inset-right));
}

.main-footer {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* ----- Extra small phones (< 380px) ----- */
@media (max-width: 379px) {
    html, body {
        overflow-x: hidden !important;
    }
    .welcome-screen {
        padding: 1rem;
        max-width: 100%;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .welcome-subtitle {
        font-size: 1.1rem;
    }

    .welcome-description {
        font-size: 0.9375rem;
        margin: 1.25rem 0 2rem;
    }

    .logo-image {
        width: 80px;
        height: 80px;
    }

    .btn-commander {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
        min-height: 44px;
    }

    .container {
        padding: 0.375rem;
        padding-top: 3.5rem;
    }

    .form-content-wrapper {
        padding: 0.5rem;
    }

    .section-title {
        font-size: 0.9375rem;
    }

    .stepper-container {
        padding: 0.35rem 0.4rem;
    }

    .step-circle {
        width: 26px;
        height: 26px;
        font-size: 0.625rem;
    }

    .step-label {
        font-size: 0.5625rem;
    }

    .step.active .step-label {
        font-size: 0.625rem;
    }

    .step-line {
        margin: 0 0.15rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .button-group .btn-primary,
    .button-group .btn-secondary {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }

    .structure-type-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .command-type-card {
        padding: 1rem;
    }

    .card-title {
        font-size: 0.9375rem;
    }

    .card-subtitle {
        font-size: 0.75rem;
    }

    .materiel-item {
        padding: 0.5rem;
        flex-wrap: wrap;
    }

    .license-item .checkbox-label span {
        font-size: 0.875rem;
    }

    .quantity-input {
        width: 100%;
        max-width: 120px;
    }

    .confirmation-wrapper {
        padding: 0.75rem;
    }

    .confirmation-title {
        font-size: 1rem;
    }

    .note-client-section {
        padding: 0.75rem;
    }

    .note-textarea {
        min-height: 80px;
        padding: 0.75rem;
    }

    .error-popup {
        width: 95%;
        max-height: 90vh;
    }
}

/* ----- Small phones (380px - 479px) ----- */
@media (min-width: 380px) and (max-width: 479px) {
    .welcome-title {
        font-size: 2.25rem;
    }

    .welcome-subtitle {
        font-size: 1.2rem;
    }

    .btn-commander {
        min-height: 44px;
    }

    .button-group .btn-primary,
    .button-group .btn-secondary {
        min-height: 44px;
    }
}

/* ----- Phones (480px - 639px) ----- */
@media (min-width: 480px) and (max-width: 639px) {
    .welcome-title {
        font-size: 2.75rem;
    }

    .container {
        padding: 0.75rem;
        padding-top: 4rem;
    }
}

/* ----- Tablets (640px - 1023px) ----- */
@media (min-width: 640px) and (max-width: 1023px) {
    .welcome-screen {
        padding: 2.5rem;
    }

    .welcome-content {
        max-width: 560px;
    }

    .container {
        max-width: 100%;
        padding: 1.5rem 2rem 0 2rem;
        padding-top: 2rem;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .structure-type-buttons {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .structure-type-btn {
        flex: 1 1 200px;
    }

    .command-type-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .stepper-container {
        padding: 0.5rem 1rem;
    }

    .step-label {
        font-size: 0.6875rem;
    }

    .confirmation-wrapper {
        padding: 1.25rem;
    }

    .summary-section strong {
        min-width: 100px;
    }
}

/* ----- Desktop (1024px+) ----- */
@media (min-width: 1024px) {
    .welcome-screen {
        padding: 3rem;
    }

    .welcome-content {
        max-width: 700px;
    }

    /* PC : toute la largeur avec marge moyenne */
    .container {
        width: 100%;
        max-width: 1400px;
        padding: 2rem 2.5rem 0 2.5rem;
        margin-left: auto;
        margin-right: auto;
    }

    .form-layout {
        flex-direction: row;
        align-items: stretch;
        gap: 0;
    }

    .form-sidebar {
        width: 240px;
        min-width: 240px;
        padding: 1.25rem 1rem;
        background: linear-gradient(180deg, #fafafa 0%, #f1f5f9 100%);
        border-right: 1px solid #e2e8f0;
        border-radius: 0.75rem 0 0 0.75rem;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .form-sidebar .stepper-container.stepper-sidebar {
        margin-bottom: 0;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .form-sidebar .stepper {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        margin: 0;
        padding: 0;
        flex: 1;
        min-height: 0;
    }

    .form-sidebar .step {
        flex-direction: row;
        flex: none;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        padding: 0.25rem 0;
    }

    .form-sidebar .step:hover {
        transform: none;
    }

    .form-sidebar .step-label {
        margin-top: 0;
        text-align: left;
        font-size: 0.8125rem;
    }

    .form-sidebar .step.active .step-label {
        font-size: 0.875rem;
    }

    .form-sidebar .step-line {
        width: 2px;
        height: 20px;
        min-height: 20px;
        margin: 0 0 0 15px;
        flex: none;
        top: 0;
    }

    .form-sidebar .step-line-fill {
        width: 100%;
        height: 0;
        transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .form-sidebar .step.completed + .step-line .step-line-fill {
        height: 100%;
    }

    .form-sidebar .step.active ~ .step .step-line-fill {
        height: 0;
    }

    .form-sidebar .progress-bar {
        margin-top: 1rem;
        flex-shrink: 0;
    }

    .form-main {
        flex: 1;
        min-width: 0;
        border-radius: 0 0.75rem 0.75rem 0;
        overflow: hidden;
    }

    .form-container {
        padding: 0 1rem 0;
        border-radius: 0 0.75rem 0.75rem 0;
    }

    .form-content-wrapper {
        padding: 1rem 1.25rem 0 1.25rem;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section {
        margin-bottom: 1rem;
    }

    .section-title {
        font-size: 1.0625rem;
    }

    .stepper-container {
        padding: 0.5rem 1rem;
    }

    .step-navigation {
        padding-bottom: 0;
    }

    .button-group {
        padding: 1rem 0 0 0;
    }

    .btn-back-home {
        padding: 0.75rem 1.5rem;
    }
}

/* ----- Large desktop (1280px+) ----- */
@media (min-width: 1280px) {
    .container {
        max-width: 1600px;
        padding: 2rem 3rem 0 3rem;
    }

    .form-content-wrapper {
        padding: 1.25rem 1.5rem 0 1.5rem;
    }

    .step-navigation {
        padding-bottom: 0;
    }
}

/* ----- Extra large desktop (1536px+) : marges confortables ----- */
@media (min-width: 1536px) {
    .container {
        padding: 2rem 4rem 0 4rem;
    }
}

/* ----- intl-tel-input: country list on small screens ----- */
@media (max-width: 639px) {
    .iti__country-list {
        max-height: min(50vh, 260px);
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 8px;
    }
}

/* ----- Form scroll on short viewports ----- */
@media (max-height: 600px) {
    .form-wrapper {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .form-content-wrapper {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .welcome-screen {
        padding: 1.5rem 1rem;
        min-height: auto;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .welcome-title {
        font-size: 2.25rem;
    }

    .welcome-description {
        margin: 1rem 0 1.5rem;
    }
}
