/**
 * Styles pour le système de création boutique / inscription livreur
 */

/* ==================== CHOIX DU TYPE DE COMPTE ==================== */
.account-choice-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 1rem 0;
}

.choice-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.choice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #7B2CBF; /* Violet UMOA - couleur unie */
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.choice-card:hover {
    border-color: #7B2CBF;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(123, 44, 191, 0.2);
}

.choice-card:hover::before {
    transform: scaleX(1);
}

.choice-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.choice-card h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.choice-card p {
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.choice-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    text-align: left;
}

.choice-features li {
    padding: 0.5rem 0;
    color: #495057;
    font-size: 0.9rem;
}

.choice-card .btn {
    margin-top: 1rem;
    width: 100%;
}

/* ==================== FORMULAIRES ==================== */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #7B2CBF;
    display: inline-block;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #7B2CBF;
    box-shadow: 0 0 0 3px rgba(123, 44, 191, 0.1);
}

.form-control.is-valid {
    border-color: #28a745;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-error {
    display: block;
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.35rem;
    min-height: 1.2rem;
}

.form-text {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.35rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* ==================== INPUT GROUP ==================== */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    background: #e9ecef;
    border: 2px solid #e9ecef;
    border-right: none;
    border-radius: 6px 0 0 6px;
}

.input-group .form-control {
    border-radius: 0 6px 6px 0;
}

/* ==================== PREVIEW D'IMAGES ==================== */
.image-preview {
    display: none;
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e9ecef;
}

.image-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
}

/* ==================== TYPES DE VÉHICULES ==================== */
.vehicle-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .vehicle-types {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .vehicle-types {
        grid-template-columns: 1fr;
    }
}

.vehicle-type-card {
    cursor: pointer;
    position: relative;
}

.vehicle-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.vehicle-card-content {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1.2rem 0.8rem;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.vehicle-type-card:hover .vehicle-card-content {
    border-color: #7B2CBF;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(123, 44, 191, 0.2);
}

.vehicle-type-card input[type="radio"]:checked + .vehicle-card-content {
    background: #7B2CBF; /* Violet UMOA - couleur unie */
    border-color: #7B2CBF;
    color: white;
}

.vehicle-icon {
    font-size: 2.2rem;
    margin-bottom: 0.4rem;
    line-height: 1;
}

.vehicle-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

/* ==================== BOUTON RETOUR ==================== */
.modal-back {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    position: absolute;
    left: 1.5rem;
}

.modal-back:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-header {
    position: relative;
}

.modal-header .modal-title {
    text-align: center;
    flex: 1;
}

/* ==================== ACTIONS DU FORMULAIRE ==================== */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
}

.form-actions .btn {
    min-width: 150px;
}

/* ==================== INFO BOX ==================== */
.form-info {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin: 1.5rem 0;
}

.form-info p {
    margin: 0;
    color: #004085;
    font-size: 0.9rem;
}

/* ==================== SPINNER ==================== */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 0.875rem;
    height: 0.875rem;
    border-width: 0.125em;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .account-choice-container {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .vehicle-types {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .modal-back {
        position: static;
        margin-bottom: 1rem;
    }
    
    .modal-header .modal-title {
        text-align: left;
    }
    
    /* Cacher la section Documents requis sur mobile */
    .documents-section {
        display: none !important;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section {
    animation: fadeInUp 0.5s ease;
}

/* ==================== ÉTATS DES BOUTONS ==================== */
.btn {
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==================== SELECT CUSTOM ==================== */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    appearance: none;
}

/* ==================== FILE INPUT ==================== */
input[type="file"].form-control {
    padding: 0.5rem 1rem;
    min-height: 44px; /* Taille minimale pour le touch sur mobile */
    cursor: pointer;
    -webkit-tap-highlight-color: transparent; /* Désactiver le highlight sur mobile */
}

input[type="file"].form-control::file-selector-button {
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    background: #7B2CBF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 36px; /* Taille minimale pour le touch */
}

input[type="file"].form-control::file-selector-button:hover {
    background: #5568d3;
}

/* Améliorations pour mobile */
@media (max-width: 768px) {
    input[type="file"].form-control {
        padding: 0.75rem 1rem;
        font-size: 16px; /* Éviter le zoom automatique sur iOS */
        width: 100%;
        min-height: 48px; /* Zone de touch plus grande sur mobile */
    }
    
    input[type="file"].form-control::file-selector-button {
        padding: 0.625rem 1.25rem;
        font-size: 15px;
        min-height: 40px;
        margin-right: 0.75rem;
    }
    
    /* S'assurer que l'input est bien cliquable */
    input[type="file"].form-control:active {
        background-color: #f8f9fa;
    }
}

/* ==================== TEXTAREA ==================== */
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ==================== FOCUS VISIBLE ==================== */
.form-control:focus-visible {
    outline: 2px solid #7B2CBF;
    outline-offset: 2px;
}

/* ==================== VALIDATION STATES ==================== */
.was-validated .form-control:valid {
    border-color: #28a745;
}

.was-validated .form-control:invalid {
    border-color: #dc3545;
}

/* ==================== ACCESSIBILITÉ ==================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==================== RESPONSIVE MOBILE ==================== */
@media (max-width: 768px) {
    .account-choice-container {
        grid-template-columns: 1fr; /* Une colonne sur mobile */
        gap: 1.5rem;
        padding: 0.5rem 0;
    }
    
    .choice-card {
        padding: 1.5rem;
    }
    
    .choice-icon {
        font-size: 3rem;
    }
    
    .choice-card h4 {
        font-size: 1.25rem;
    }
    
    .form-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .form-section-title {
        font-size: 1.1rem;
    }
    
    /* Assurer que les modales sont bien formatées */
    .modal-overlay {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); /* Espace pour navbar bottom */
    }
    
    .modal-container,
    .modal-content {
        max-height: calc(100vh - calc(64px + env(safe-area-inset-bottom, 0px))) !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
    }
    
    .modal-body {
        max-height: calc(100vh - calc(64px + env(safe-area-inset-bottom, 0px)) - 140px) !important;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
}

