/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e8f5e3 0%, #d4e9cf 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    font-size: 48px;
    font-weight: bold;
    color: #2d5016;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 18px;
    color: #5a7c3e;
}

/* Chatbot container */
.chatbot-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    min-height: 500px;
}

.chat-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Message d'accueil */
.welcome-message {
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.welcome-message h2 {
    font-size: 32px;
    color: #2d5016;
    margin-bottom: 15px;
}

.welcome-message p {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

/* Question */
.question-separator {
    border: none;
    border-top: 1px solid #d4e9cf;
    margin: 20px 0;
}

.question {
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-in;
}

.question h3 {
    font-size: 24px;
    color: #2d5016;
    margin-bottom: 20px;
    text-align: center;
}

.question-subtitle {
    font-size: 1.2rem;
    color: #2d5016;
    margin: 2.5rem auto 1.5rem auto;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem 0;
    border-bottom: 2px solid #7ba05b;
    max-width: 400px;
    display: block;
}

/* Options */
.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

/* Pour les domaines : grille */
.options.domaines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    max-width: 900px;
    justify-items: center;
}

/* Nouveau design des boutons - plus épuré */
.option-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.option-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border-color: #7ba05b;
    background: #f9fdf7;
}

.option-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.option-icon {
    font-size: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d5016;
    line-height: 1.4;
}

.option-description {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
}

.option-count {
    font-size: 12px;
    color: #7ba05b;
    font-weight: 600;
}

/* Sections de catégories */
.category-section {
    margin-bottom: 30px;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d5016;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grille 2 colonnes pour les boutons */
.options-grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* Boutons horizontaux épurés */
.option-btn-horizontal {
    background: white;
    border: 2px solid #d4e9cf;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
    font-family: inherit;
    width: 100%;
}

.option-btn-horizontal:hover:not(:disabled) {
    background: #f9fdf7;
    border-color: #7ba05b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.option-btn-horizontal:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f5f5;
}

.option-btn-horizontal .option-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.option-text-horizontal {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.option-text-horizontal strong {
    font-size: 16px;
    color: #2d5016;
    font-weight: 600;
}

.option-text-horizontal small {
    font-size: 13px;
    color: #7ba05b;
    font-weight: 500;
}

/* Bouton retour */
.back-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.back-btn:hover {
    background: #e8e8e8;
}

/* Résultats */
.results {
    animation: fadeIn 0.5s ease-in;
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.results h2 {
    font-size: 28px;
    color: #2d5016;
    margin-bottom: 10px;
}

.results-subtitle {
    font-size: 14px;
    color: #666;
}

.formation-card {
    background: #f9fdf7;
    border: 1px solid #d4e9cf;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.formation-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.formation-title {
    font-size: 20px;
    font-weight: 600;
    color: #2d5016;
    margin-bottom: 10px;
}

.formation-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.formation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
}

.formation-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.formation-formateurs {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
}

.formation-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.formation-link {
    display: inline-block;
    background: #e8833a;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.formation-link:hover {
    background: #d67329;
    transform: translateX(5px);
}

.formation-register-btn {
    background: #7ba05b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.formation-register-btn:hover {
    background: #6a8f4f;
}

/* Modal d'inscription */
.register-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease-in;
}

.register-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.register-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.register-modal-header h3 {
    font-size: 20px;
    color: #2d5016;
    margin: 0;
}

.register-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.register-modal-close:hover {
    color: #2d5016;
}

.register-modal-body {
    padding: 25px;
}

.register-modal-body p {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d5016;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #7ba05b;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

.btn-cancel {
    background: white;
    border: 2px solid #ddd;
    color: #666;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #f5f5f5;
}

.btn-submit {
    background: #7ba05b;
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: #6a8f4f;
}

/* Actions finales */
.final-actions {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #d4e9cf;
    text-align: center;
}

.final-actions p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

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

.final-action-btn {
    padding: 12px 24px;
    border: 2px solid #7ba05b;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.final-action-btn.restart {
    background: white;
    color: #7ba05b;
}

.final-action-btn.restart:hover {
    background: #7ba05b;
    color: white;
}

.final-action-btn.all {
    background: #7ba05b;
    color: white;
}

.final-action-btn.all:hover {
    background: #6a8f4f;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    color: #5a7c3e;
    font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #7ba05b;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        padding: 25px;
    }
    
    .logo {
        font-size: 36px;
    }
    
    .options {
        grid-template-columns: 1fr;
    }
    
    .option-btn {
        flex-direction: row;
        text-align: left;
    }
    
    .final-actions-buttons {
        flex-direction: column;
    }
    
    .formation-actions {
        flex-direction: column;
    }
    
    .formation-link,
    .formation-register-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}


/* Modal Brevo */
.brevo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.brevo-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.brevo-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.brevo-modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.brevo-form-container {
    padding: 20px;
}
