/**
 * maturation-validation-modal.css
 * Styles pour la modale de validation du parcours de maturation
 * Architecture: Material Design modal avec formulaire interactif
 */

/* ============================================
   Overlay et conteneur
   ============================================ */
.maturation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.maturation-modal-overlay.modal-visible {
    opacity: 1;
}

.maturation-modal {
    background: #fdfcfa;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.maturation-modal-overlay.modal-visible .maturation-modal {
    transform: scale(1);
}

/* ============================================
   Header
   ============================================ */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid #e5e5e5;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #566c40;
    margin: 0;
}

.modal-title .material-symbols-outlined {
    font-size: 28px;
    color: #566c40;
}

.modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-close .material-symbols-outlined {
    font-size: 24px;
}

/* ============================================
   Body
   ============================================ */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-intro {
    font-size: 15px;
    line-height: 1.6;
    color: #544840;
    margin-bottom: 24px;
    padding: 16px;
    background: #f7f5f2;
    border-radius: 8px;
    border-left: 4px solid #566c40;
}

.validation-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ============================================
   Form Groups
   ============================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.form-label .material-symbols-outlined {
    font-size: 20px;
    color: #566c40;
}

.form-error {
    font-size: 13px;
    color: #ef4444;
    min-height: 20px;
}

.form-hint {
    font-size: 13px;
    color: #6b7280;
}

/* ============================================
   Impact Rating (boutons 1-5)
   ============================================ */
.impact-rating {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.impact-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.impact-option:hover {
    border-color: #566c40;
    background: #f7f5f2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(86, 108, 64, 0.15);
}

.impact-option.selected {
    border-color: #566c40;
    background: #566c40;
    box-shadow: 0 4px 12px rgba(86, 108, 64, 0.25);
}

.impact-option.selected .impact-number,
.impact-option.selected .impact-label {
    color: white;
}

.impact-number {
    font-size: 24px;
    font-weight: 700;
    color: #566c40;
    line-height: 1;
}

.impact-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-align: center;
}

/* ============================================
   Textarea
   ============================================ */
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-textarea:focus {
    outline: none;
    border-color: #566c40;
}

.form-textarea::placeholder {
    color: #9ca3af;
}

#char-count {
    font-weight: 600;
    color: #566c40;
}

/* ============================================
   Footer
   ============================================ */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e5e5e5;
}

.btn-cancel {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #1f2937;
}

.btn-validate {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: #566c40;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-validate:hover:not(:disabled) {
    background: #4a5b37;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(86, 108, 64, 0.3);
}

.btn-validate:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-validate .material-symbols-outlined {
    font-size: 20px;
}

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

.rotating {
    animation: rotate 1s linear infinite;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .maturation-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .maturation-modal {
        max-width: 100%;
        max-height: 95vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-body {
        padding: 20px;
    }

    /* Impact rating en 2 colonnes sur mobile */
    .impact-rating {
        grid-template-columns: repeat(3, 1fr);
    }

    .impact-option {
        padding: 12px 4px;
    }

    .impact-number {
        font-size: 20px;
    }

    .impact-label {
        font-size: 11px;
    }

    .modal-footer {
        padding: 16px 20px;
        flex-direction: column-reverse;
    }

    .btn-cancel,
    .btn-validate {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   Accessibilité
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .maturation-modal-overlay,
    .maturation-modal,
    .impact-option,
    .btn-cancel,
    .btn-validate {
        transition: none;
    }

    .rotating {
        animation: none;
    }
}

.modal-close:focus-visible,
.impact-option:focus-visible,
.form-textarea:focus-visible,
.btn-cancel:focus-visible,
.btn-validate:focus-visible {
    outline: 2px solid #566c40;
    outline-offset: 2px;
}
