/* Styles pour la page de devis Secure24 - Version Responsive Mobile */

/* Barre de progression */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    border-radius: 9999px;
    transition: width 0.3s ease;
    width: 25%;
}

/* Optimisation mobile de la barre de progression */
@media (max-width: 640px) {
    .progress-bar-container {
        height: 6px;
    }
}

/* Styles pour les services sélectionnés */
.service-selected {
    border-color: #2563eb !important;
    background-color: #eff6ff !important;
}

input[type="radio"]:checked + div {
    border-color: #2563eb;
}

/* Animation scale pour les interactions tactiles */
.active\:scale-98:active {
    transform: scale(0.98);
}

/* Amélioration des labels de service */
label.cursor-pointer {
    user-select: none;
    -webkit-user-select: none;
}

/* État focus pour les labels de service (accessibilité) */
label:has(input[type="radio"]:focus-visible),
label:has(input[type="checkbox"]:focus-visible) {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Styles pour les photos */
.upload-container {
    position: relative;
}

.file-input {
    display: none;
}

.photo-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.photo-preview-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.photo-preview-item:hover {
    transform: scale(1.05);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-photo {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: rgba(239, 68, 68, 0.9);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.remove-photo:hover {
    background-color: rgba(220, 38, 38, 1);
}

/* Modal pour l'aperçu des photos */
.photo-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.photo-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

.photo-modal-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.photo-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 32px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.photo-modal-close:hover {
    transform: scale(1.1);
}

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

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Styles pour les étapes */
.step-circle {
    transition: all 0.3s ease;
}

.step-active {
    background-color: #2563eb !important;
    color: white !important;
}

.step-completed {
    background-color: #10b981 !important;
    color: white !important;
}

/* ====================================
   STYLES RESPONSIVE MOBILE
   ==================================== */

/* Tablettes et petits écrans (max 1024px) */
@media (max-width: 1024px) {
    .photo-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}

/* Tablettes portrait (max 768px) */
@media (max-width: 768px) {
    .photo-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .photo-modal-content {
        max-width: 95%;
        max-height: 80%;
    }
    
    /* Optimisation des cartes de service pour tablette */
    label.block {
        padding: 1rem !important;
    }
    
    /* Réduire l'espacement entre les éléments */
    .space-y-6 > * + * {
        margin-top: 1.25rem !important;
    }
}

/* Smartphones (max 640px) */
@media (max-width: 640px) {
    /* Header mobile optimisé */
    header img {
        max-height: 40px !important;
    }
    
    /* Colonne latérale devient horizontale sur mobile */
    .sticky {
        position: relative !important;
        top: 0 !important;
    }
    
    /* Réduction de l'espacement du conteneur principal */
    main {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    /* Optimisation des cartes blanches */
    .bg-white.rounded-xl {
        padding: 1.25rem !important;
        border-radius: 0.75rem !important;
    }
    
    /* Étapes de gauche - format compact mobile */
    .lg\:w-1\/3 .space-y-6 {
        display: none; /* On cache les détails sur très petit écran */
    }
    
    /* Afficher seulement le titre des étapes sur mobile */
    .lg\:w-1\/3 h2 {
        font-size: 1.25rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Bloc d'aide toujours visible */
    .bg-blue-50 {
        display: block !important;
        margin-top: 1rem !important;
    }
    
    /* Titres de formulaire mobile */
    h2.text-2xl {
        font-size: 1.5rem !important;
        margin-bottom: 1.25rem !important;
    }
    
    h3.text-lg {
        font-size: 1rem !important;
    }
    
    /* Cartes de service mobile */
    label.block.p-4 {
        padding: 0.875rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* Icônes de service réduites */
    .w-12.h-12 {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
    
    .w-12.h-12 i {
        font-size: 1.25rem !important;
    }
    
    /* Textes de service */
    label h3 {
        font-size: 1rem !important;
        line-height: 1.4 !important;
    }
    
    label p {
        font-size: 0.8125rem !important;
        line-height: 1.3 !important;
        margin-top: 0.125rem !important;
    }
    
    /* Inputs et selects optimisés pour tactile */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea {
        padding: 0.875rem !important;
        font-size: 16px !important; /* Évite le zoom sur iOS */
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Labels plus compacts */
    label.block {
        margin-bottom: 0.5rem !important;
    }
    
    /* Grid à 1 colonne sur mobile */
    .grid.grid-cols-1.md\:grid-cols-2 {
        gap: 1rem !important;
    }
    
    /* Checkboxes plus grandes pour le tactile */
    input[type="checkbox"] {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
    }
    
    /* Zones de checkbox plus grandes */
    label.flex.items-center.p-3 {
        padding: 0.875rem !important;
        min-height: 52px; /* Zone tactile optimale */
    }
    
    /* Upload de photos mobile */
    .upload-container button {
        width: 100% !important;
        padding: 0.875rem !important;
        font-size: 0.9375rem !important;
    }
    
    .photo-preview-container {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    
    /* Boutons de navigation mobile */
    #prevBtn,
    #nextBtn {
        padding: 0.875rem 1.25rem !important;
        font-size: 0.9375rem !important;
        min-height: 48px; /* Zone tactile recommandée */
    }
    
    .flex.justify-between.pt-6 {
        gap: 0.75rem !important;
    }
    
    /* Récapitulatif mobile */
    .bg-gray-50.rounded-lg {
        padding: 1rem !important;
    }
    
    .ml-9 {
        margin-left: 2rem !important;
    }
    
    /* Icônes du récapitulatif */
    .fas.text-2xl {
        font-size: 1.25rem !important;
    }
    
    /* Grid du récapitulatif en 1 colonne */
    .ml-9.grid.grid-cols-1.md\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    /* Photos du récapitulatif */
    #summary-photos {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    /* Textes plus petits sur mobile */
    .text-gray-600 {
        font-size: 0.875rem !important;
        line-height: 1.4 !important;
    }
    
    /* Espacements réduits */
    .space-y-6 > * + * {
        margin-top: 1rem !important;
    }
    
    .space-y-4 > * + * {
        margin-top: 0.75rem !important;
    }
    
    .space-y-3 > * + * {
        margin-top: 0.5rem !important;
    }
    
    /* Bloc d'information */
    .bg-blue-50.rounded-lg.border {
        padding: 0.875rem !important;
    }
    
    .bg-blue-50 p {
        font-size: 0.8125rem !important;
    }
    
    /* Modal photo en plein écran sur mobile */
    .photo-modal-content {
        max-width: 100% !important;
        max-height: 100% !important;
        padding: 1rem;
    }
    
    .photo-modal-close {
        top: 1rem !important;
        right: 1rem !important;
        font-size: 28px !important;
        background: rgba(0, 0, 0, 0.5);
        width: 40px;
        height: 40px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }
}

/* Très petits smartphones (max 375px) */
@media (max-width: 375px) {
    /* Encore plus compact */
    h2.text-2xl {
        font-size: 1.375rem !important;
    }
    
    label.block.p-4 {
        padding: 0.75rem !important;
    }
    
    .w-12.h-12 {
        width: 2.25rem !important;
        height: 2.25rem !important;
    }
    
    label h3 {
        font-size: 0.9375rem !important;
    }
    
    label p {
        font-size: 0.75rem !important;
    }
    
    #prevBtn,
    #nextBtn {
        font-size: 0.875rem !important;
        padding: 0.75rem 1rem !important;
    }
    
    .photo-preview-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Animations pour les transitions entre étapes */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.space-y-6 > * {
    animation: slideIn 0.3s ease;
}

/* Styles pour le résumé */
.summary-photo-item {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.summary-photo-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Style pour les checkbox */
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #2563eb;
}

/* Amélioration des boutons */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spin animation pour le loader */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Hover effects pour les cartes de service */
label:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Focus visible pour l'accessibilité */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ====================================
   OPTIMISATIONS TACTILES MOBILE
   ==================================== */

/* Amélioration des zones tactiles */
@media (max-width: 640px) {
    /* Tous les éléments cliquables ont une zone tactile minimale de 44x44px */
    button,
    a,
    input[type="radio"] + div,
    input[type="checkbox"] + div,
    label {
        -webkit-tap-highlight-color: rgba(37, 99, 235, 0.1);
        touch-action: manipulation;
    }
    
    /* Désactiver le zoom sur les inputs */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Smooth scroll pour mobile */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Optimisation du sticky pour mobile */
    .sticky {
        position: relative !important;
    }
}

/* ====================================
   ANIMATIONS MOBILE
   ==================================== */

@media (max-width: 640px) {
    /* Animations plus rapides sur mobile */
    .transition-all,
    .transition-colors,
    .transition-transform {
        transition-duration: 200ms !important;
    }
    
    /* Désactiver les animations complexes sur mobile pour la performance */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}

/* ====================================
   ORIENTATION PAYSAGE MOBILE
   ==================================== */

@media (max-width: 768px) and (orientation: landscape) {
    /* Header plus compact en paysage */
    header {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
    
    /* Formulaire en mode paysage */
    main {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    .bg-white.rounded-xl {
        padding: 1rem !important;
    }
    
    /* Modal prend moins d'espace en hauteur */
    .photo-modal-content {
        max-height: 85% !important;
    }
}

/* ====================================
   DARK MODE SUPPORT (optionnel)
   ==================================== */

@media (prefers-color-scheme: dark) {
    /* Si vous voulez supporter le dark mode plus tard */
    /* Les styles sont commentés pour ne pas perturber le design actuel */
    /*
    body {
        background-color: #1f2937;
        color: #f9fafb;
    }
    */
}

/* ====================================
   PRINT STYLES (pour impression)
   ==================================== */

@media print {
    /* Masquer les éléments non nécessaires à l'impression */
    header,
    #prevBtn,
    #nextBtn,
    .photo-modal,
    .remove-photo {
        display: none !important;
    }
    
    /* Optimiser pour l'impression */
    body {
        background: white;
    }
    
    .bg-gray-50 {
        background: white !important;
        border: 1px solid #e5e7eb !important;
    }
}

/* ====================================
   ACCESSIBILITÉ AMÉLIORÉE
   ==================================== */

/* High contrast mode */
@media (prefers-contrast: high) {
    .progress-bar,
    button,
    .bg-blue-600 {
        border: 2px solid currentColor;
    }
}

/* Réduire les animations si demandé */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}



.grecaptcha-badge {
    display: none !important;
}