/* JMTL Chat — widget aux couleurs du site (bleu marine #0e0a33 + accents) */

.jmtl-chat, .jmtl-chat * { box-sizing: border-box; }

/* ==== Floating mode ==== */
.jmtl-chat.jmtl-chat-floating {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    font-family: inherit;
    color: #0e0a33;
}

.jmtl-chat-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 999px;
    background: #0e0a33;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(14, 10, 51, 0.3);
    transition: transform .15s, background .15s, box-shadow .15s;
}
.jmtl-chat-toggle:hover { background: #1c1654; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(14, 10, 51, 0.35); }
.jmtl-chat-toggle-icon { font-size: 20px; line-height: 1; }
.jmtl-chat-toggle-label { letter-spacing: .3px; }

.jmtl-chat.jmtl-chat-floating .jmtl-chat-panel {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: 360px;
    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(14, 10, 51, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(14, 10, 51, 0.08);
    animation: jmtl-chat-pop .25s ease;
}
@keyframes jmtl-chat-pop {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.jmtl-chat.jmtl-chat-floating .jmtl-chat-panel[hidden] { display: none; }

/* ==== Embedded mode (Contact page) ==== */
.jmtl-chat.jmtl-chat-embedded {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    color: #0e0a33;
    font-family: inherit;
}
.jmtl-chat.jmtl-chat-embedded .jmtl-chat-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(14, 10, 51, 0.10);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(14, 10, 51, 0.08);
    min-height: 480px;
}

/* ==== Common panel styling ==== */
.jmtl-chat-header {
    background: linear-gradient(135deg, #0e0a33 0%, #1c1654 100%);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.jmtl-chat-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.jmtl-chat-bubble {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.jmtl-chat-header-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.jmtl-chat-header-status { font-size: 12px; opacity: .85; margin-top: 2px; }

.jmtl-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: .8;
    transition: opacity .15s;
}
.jmtl-chat-close:hover { opacity: 1; }

.jmtl-chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f8fafc;
    min-height: 200px;
    max-height: 360px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.jmtl-chat.jmtl-chat-embedded .jmtl-chat-thread { max-height: none; flex: 1 1 auto; }

.jmtl-chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: jmtl-msg-in .2s ease;
}
@keyframes jmtl-msg-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.jmtl-chat-msg-admin {
    align-self: flex-start;
    background: #fff;
    color: #0e0a33;
    border: 1px solid rgba(14,10,51,0.08);
    border-bottom-left-radius: 4px;
}
.jmtl-chat-msg-visitor {
    align-self: flex-end;
    background: #0e0a33;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.jmtl-chat-msg-system {
    align-self: center;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-style: italic;
    max-width: 95%;
    text-align: center;
}
.jmtl-chat-msg-welcome { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }

.jmtl-chat-coords {
    border-top: 1px solid rgba(14,10,51,0.08);
    background: #fff;
}
.jmtl-chat-coords-toggle {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 10px 16px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    font-weight: 600;
}
.jmtl-chat-coords-toggle:hover { background: #f1f5f9; }
.jmtl-chat-coords-label {
    padding: 10px 16px 4px;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.jmtl-chat-required { color: #af1616; font-weight: 700; }
.jmtl-chat-coords-fields {
    padding: 8px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.jmtl-chat-coords-fields input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(14,10,51,0.12);
    border-radius: 10px;
    font-size: 14px;
    color: #0e0a33;
    background: #fff;
    box-sizing: border-box;
}
.jmtl-chat-coords-fields input:focus {
    outline: none;
    border-color: #0e0a33;
    box-shadow: 0 0 0 3px rgba(14,10,51,0.1);
}
.jmtl-chat-coords-badge {
    padding: 6px 14px;
    font-size: 12px;
    color: #0e0a33;
    font-weight: 600;
    background: #f8fafc;
    border-top: 1px solid rgba(14,10,51,0.08);
}

.jmtl-chat-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid rgba(14,10,51,0.08);
    align-items: flex-end;
}
.jmtl-chat-input-row textarea {
    flex: 1;
    border: 1px solid rgba(14,10,51,0.15);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.4;
    color: #0e0a33;
    resize: none;
    max-height: 120px;
    min-height: 40px;
    font-family: inherit;
    background: #f8fafc;
}
.jmtl-chat-input-row textarea:focus {
    outline: none;
    border-color: #0e0a33;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(14,10,51,0.08);
}
.jmtl-chat-send {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0e0a33;
    color: #fff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
}
.jmtl-chat-send:hover:not(:disabled) { background: #1c1654; transform: scale(1.05); }
.jmtl-chat-send:disabled { background: #cbd5e1; cursor: not-allowed; }

.jmtl-chat-actions {
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(14,10,51,0.08);
}
.jmtl-chat-action {
    flex: 1;
    padding: 12px;
    text-align: center;
    text-decoration: none !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 14px;
    transition: filter .15s;
}
.jmtl-chat-action:hover { filter: brightness(1.1); }
.jmtl-chat-action-wa { background: #25D366; }
.jmtl-chat-action-tel { background: #ff5b0c; }

/* ==== Preheader link ==== */
#jmtl-chat-preheader-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    margin-left: 13px;
    position: relative;
    font-weight: inherit;
}
#jmtl-chat-preheader-link:hover { opacity: .7; }

/* ==== Mobile ==== */
@media (max-width: 480px) {
    .jmtl-chat.jmtl-chat-floating { right: 12px; bottom: 12px; }
    .jmtl-chat.jmtl-chat-floating .jmtl-chat-panel {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 80px);
        bottom: 64px;
    }
    .jmtl-chat-toggle-label { display: none; }
    .jmtl-chat-toggle { padding: 14px; }
    .jmtl-chat-toggle-icon { font-size: 22px; }
}
