/* ==========================================================================
   Chatbot Inscription – Événement 18 juin 2026
   Inspiré du design du module chatbot Strategia (style iOS/messenger)
   ========================================================================== */

/* Wrapper global */
.evtchat-wrapper {
    max-width: 480px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Conteneur principal */
#evtchat-container {
    background: #f2f2f7;
    border-radius: 20px;
    box-shadow: 0 8px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 620px;
}

/* ---- Header ---- */
.evtchat-header {
    background: #031B2F;
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.evtchat-header-avatar {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.evtchat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.evtchat-header-info h3 {
    margin: 0 0 2px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff !important;
}

.evtchat-header-info p {
    margin: 0;
    font-size: 0.78rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}

.evtchat-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4cda6a;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---- Zone des messages ---- */
.evtchat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f2f2f7;
    scroll-behavior: smooth;
}

.evtchat-messages::-webkit-scrollbar {
    width: 4px;
}
.evtchat-messages::-webkit-scrollbar-thumb {
    background: #c7c7cc;
    border-radius: 4px;
}

/* ---- Bulles ---- */
.evtchat-bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 20px;
    line-height: 1.45;
    font-size: 15px;
    word-wrap: break-word;
    animation: evtchat-pop-in 0.25s ease;
}

@keyframes evtchat-pop-in {
    from { opacity: 0; transform: scale(0.9) translateY(6px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);   }
}

/* Bulle bot (gauche) */
.evtchat-bubble.evtchat-bot {
    background: #fff;
    color: #1c1c1e;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Bulle utilisateur (droite) */
.evtchat-bubble.evtchat-user {
    background: #031B2F;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

/* ---- Indicateur de frappe (3 points) ---- */
.evtchat-bubble.evtchat-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    min-width: 56px;
}

.evtchat-bubble.evtchat-typing span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #aeaeb2;
    border-radius: 50%;
    animation: evtchat-bounce 1.3s infinite ease-in-out;
}
.evtchat-bubble.evtchat-typing span:nth-child(2) { animation-delay: 0.18s; }
.evtchat-bubble.evtchat-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes evtchat-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%           { transform: translateY(-7px); }
}

/* ---- Zone de saisie ---- */
.evtchat-input-area {
    padding: 0.9rem 1rem;
    background: #fff;
    border-top: 1px solid #e5e5ea;
    min-height: 70px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Formulaire texte */
.evtchat-input-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
}

.evtchat-text-input {
    flex: 1;
    min-width: 0;
    border: 2px solid #e5e5ea;
    border-radius: 22px;
    padding: 9px 16px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    background: #f9f9f9;
}

.evtchat-text-input:focus {
    border-color: #132D98;
    background: #fff;
}

.evtchat-text-input.evtchat-input-error {
    border-color: #ff3b30;
}

.evtchat-error-msg {
    color: #ff3b30;
    font-size: 12px;
    width: 100%;
    padding: 2px 4px 0;
}

/* Bouton Envoyer */
.evtchat-send-btn {
    background: #fff !important;
    color: #132D98 !important;
    border: 2px solid #132D98 !important;
    border-radius: 20px !important;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    flex-shrink: 0;
}

.evtchat-send-btn:hover {
    background: #031B2F !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* Bouton Passer (optionnel) */
.evtchat-skip-btn {
    background: #fff !important;
    color: #132D98 !important;
    border: 2px solid #132D98 !important;
    border-radius: 20px !important;
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    flex-shrink: 0;
}

.evtchat-skip-btn:hover {
    background: #031B2F !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* ---- Boutons de choix ---- */
.evtchat-choices {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-end;
}

.evtchat-choice-btn {
    background: #fff !important;
    color: #132D98 !important;
    border: 2px solid #132D98 !important;
    border-radius: 20px !important;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
}

/* Masquer les images emoji injectées par WordPress */
.evtchat-choice-btn img.emoji {
    display: none !important;
}

/* Variante <a> pour Google Calendar */
a.evtchat-choice-btn {
    display: inline-block;
    text-decoration: none !important;
    line-height: 1.4;
}

.evtchat-choice-btn:hover {
    background: #031B2F !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* ---- Formulaire de consentement (récap + RGPD) ---- */
.evtchat-consent-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.evtchat-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13px;
    color: #3a3a3c;
    cursor: pointer;
    line-height: 1.5;
}

.evtchat-consent-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #132D98;
}

.evtchat-submit-btn {
    background: #fff !important;
    color: #132D98 !important;
    border: 2px solid #132D98 !important;
    border-radius: 20px !important;
    padding: 11px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

.evtchat-submit-btn:hover:not(:disabled) {
    background: #031B2F !important;
    color: #fff !important;
    border-color: transparent !important;
}

.evtchat-submit-btn:disabled {
    background: #f2f2f7 !important;
    color: #aeaeb2 !important;
    border-color: #e5e5ea !important;
    cursor: not-allowed;
}

/* ---- Responsive ---- */
@media (max-width: 520px) {
    .evtchat-wrapper {
        margin: 0;
    }

    #evtchat-container {
        border-radius: 0;
        height: 100svh;
    }
}
