/**
 * Styles pour le formulaire de soumission d'offres - VERSION CORRIGÉE
 * Version: 5.0.0
 */

/* ============================================
   WRAPPER PRINCIPAL DU FORMULAIRE
   ============================================ */
.mb-form-wrapper {
    background: linear-gradient(135deg, rgba(110, 159, 51, 0.03) 0%, rgba(84, 180, 53, 0.05) 50%, rgba(63, 103, 49, 0.03) 100%);
    min-height: calc(100vh - 150px);
    padding: 60px 20px 80px;
    width: 100%;
}

.mb-form-container {
    max-width: 1600px;
    width: 95%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(110, 159, 51, 0.12);
    overflow: hidden;
}

.mb-form-header {
    background: linear-gradient(135deg, #6e9f33 0%, #54B435 50%, #3F6731 100%);
    color: white;
    padding: 55px 40px;
    text-align: center;
    font-size: 2.3rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================
   FORMULAIRE
   ============================================ */
.mb-submit-form {
    padding: 50px 60px;
}

/* ============================================
   SECTIONS DU FORMULAIRE
   ============================================ */
.mb-form-section {
    background: white;
    border: 1px solid rgba(110, 159, 51, 0.12);
    border-radius: 16px;
    padding: 45px;
    margin-bottom: 35px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.mb-form-section-title {
    color: #6e9f33;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 30px;
    padding-bottom: 16px;
    border-bottom: 3px solid #6e9f33;
    display: flex;
    align-items: center;
}

/* ============================================
   LAYOUTS DE COLONNES
   ============================================ */
.mb-form-row {
    margin-bottom: 0;
}

.mb-form-row.mb-full-width {
    width: 100%;
}

.mb-form-row.mb-two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 35px;
}

.mb-form-row.mb-three-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* ============================================
   GROUPES DE CHAMPS
   ============================================ */
.mb-form-group {
    margin-bottom: 0;
}

/* ============================================
   FLOATING LABELS - CORRIGÉ
   ============================================ */
.mb-floating-label {
    position: relative;
    margin-bottom: 28px;
}

.mb-floating-label input,
.mb-floating-label textarea,
.mb-floating-label select {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid rgba(110, 159, 51, 0.2);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.mb-floating-label input:focus,
.mb-floating-label textarea:focus,
.mb-floating-label select:focus {
    border-color: #6e9f33;
    box-shadow: 0 0 0 4px rgba(110, 159, 51, 0.1);
}

/* ✅ CORRECTION: Label TOUJOURS en haut (fixe) */
.mb-floating-label label {
    position: absolute;
    left: 14px;
    top: -10px;
    font-size: 12px;
    color: #6e9f33;
    pointer-events: none;
    background: white;
    padding: 0 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Focus: juste changer la couleur */
.mb-floating-label input:focus ~ label,
.mb-floating-label textarea:focus ~ label,
.mb-floating-label select:focus ~ label {
    color: #54B435;
}

/* ============================================
   SELECT AVEC FLÈCHE PERSONNALISÉE
   ============================================ */
.mb-floating-label select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236e9f33' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 45px;
    cursor: pointer;
    /* ✅ Couleur normale pour les options */
    color: #2c3e50;
}

/* ✅ Options avec couleur normale */
.mb-floating-label select option {
    color: #2c3e50;
    background: white;
}

/* ✅ Option par défaut en gris léger */
.mb-floating-label select option:first-child {
    color: #95a5a6;
}

/* ============================================
   CHAMPS REQUIS
   ============================================ */
.required {
    color: #dc3545;
    margin-left: 4px;
}

/* ============================================
   VALIDATION - ERREURS - CORRIGÉ
   ============================================ */
.mb-field-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.mb-field-error:focus {
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.2) !important;
}

/* ✅ Message d'erreur sous le champ */
.mb-field-error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mb-field-error-message::before {
    content: '⚠️';
    font-size: 14px;
}

.mb-error-message {
    background: #fee;
    border: 2px solid #f00;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    animation: slideIn 0.5s ease;
}

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

.mb-error-message h3 {
    color: #c00;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.mb-error-message ul {
    margin: 0;
    padding-left: 20px;
}

.mb-error-message li {
    color: #c00;
    margin: 5px 0;
}

/* ============================================
   HINTS/INDICES - CORRIGÉ
   ============================================ */
.mb-field-hint {
    display: block;
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 4px;
    font-style: italic;
}

/* ============================================
   UPLOAD DE FICHIERS
   ============================================ */
.mb-file-upload-wrapper {
    position: relative;
}

.mb-file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.mb-file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    border: 3px dashed rgba(110, 159, 51, 0.3);
    border-radius: 16px;
    background: rgba(110, 159, 51, 0.03);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mb-file-label:hover {
    border-color: #6e9f33;
    background: rgba(110, 159, 51, 0.08);
    transform: translateY(-2px);
}

.mb-file-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.mb-file-text {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.mb-file-hint {
    font-size: 14px;
    color: #95a5a6;
}

.mb-file-label.mb-file-selected {
    border-color: #6e9f33;
    background: rgba(110, 159, 51, 0.1);
}

.mb-file-label.mb-file-selected .mb-file-text {
    color: #6e9f33;
    font-weight: 700;
}

/* ============================================
   BOUTON DE SOUMISSION
   ============================================ */
.mb-submit-wrapper {
    text-align: center;
    padding: 40px 0 20px;
}

.mb-submit-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #6e9f33 0%, #54B435 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(110, 159, 51, 0.25);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.mb-submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.mb-submit-button:hover:not(:disabled)::before {
    left: 100%;
}

.mb-submit-button:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px rgba(110, 159, 51, 0.35);
}

.mb-submit-button:active:not(:disabled) {
    transform: translateY(-1px) scale(1.02);
}

.mb-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.mb-submit-button:hover:not(:disabled) .btn-icon {
    transform: translateX(5px);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .mb-form-row.mb-three-columns {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mb-submit-form {
        padding: 40px 40px;
    }
    
    .mb-form-section {
        padding: 35px;
    }
}

@media (max-width: 768px) {
    .mb-form-wrapper {
        padding: 40px 15px 60px;
    }
    
    .mb-form-header {
        padding: 40px 30px;
        font-size: 1.8rem;
    }
    
    .mb-submit-form {
        padding: 30px 25px;
    }
    
    .mb-form-section {
        padding: 25px;
    }
    
    .mb-form-row.mb-two-columns,
    .mb-form-row.mb-three-columns {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .mb-form-section-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .mb-form-container {
        border-radius: 20px;
    }
    
    .mb-form-header {
        font-size: 1.5rem;
        padding: 30px 20px;
    }
    
    .mb-submit-form {
        padding: 20px 15px;
    }
    
    .mb-form-section {
        padding: 20px;
        margin-bottom: 25px;
    }
    
    .mb-floating-label input,
    .mb-floating-label textarea,
    .mb-floating-label select {
        padding: 15px 16px;
        font-size: 14px;
    }
    
    .mb-submit-button {
        width: 100%;
        justify-content: center;
        padding: 16px 40px;
    }
}

/* ============================================
   ACCÈS RESTREINT
   ============================================ */
.mb-restricted-content {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(110, 159, 51, 0.05) 0%, rgba(84, 180, 53, 0.08) 100%);
    border-radius: 20px;
    margin: 40px auto;
    max-width: 700px;
}

.mb-restricted-content h2 {
    color: #6e9f33;
    font-size: 2rem;
    margin-bottom: 20px;
}

.mb-restricted-content p {
    font-size: 1.1rem;
    color: #5a6c7d;
    margin-bottom: 30px;
}

.mb-restricted-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.mb-restricted-actions .mb-button {
    padding: 14px 30px;
    font-size: 16px;
}

@media (max-width: 480px) {
    .mb-restricted-actions {
        flex-direction: column;
    }
    
    .mb-restricted-actions .mb-button {
        width: 100%;
    }
}
