/* EazyMAX home - chat widget styles (from the product chat, same look). */
.custom-chat-modal {
    background-color: var(--em-yellow);
    border: none;
    border-radius: 16px;
    padding: 12px 16px 16px;
    width: min(720px, calc(100% - 24px));
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow: auto;
    color: #000;
}
.custom-chat-modal::backdrop { background: rgba(0, 0, 0, .6); }
html:has(dialog[open]) { overflow: hidden; }
.chat-dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.chat-dialog-head .modal-title { color: #004d3d; font-weight: 700; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); margin: 0; }
.chat-close {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #000;
    display: grid;
    place-items: center;
}
.chat-close:hover { background: rgba(0, 0, 0, .1); }
.chat-wrap { background-color: #fff; border: 2px solid var(--em-green-dark); border-radius: 14px; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background-color: var(--em-green-dark); }
.chat-av {
    width: 44px; height: 44px; border-radius: 50%;
    background-color: #fff; color: var(--em-green-dark);
    display: grid; place-items: center; font-weight: 700; position: relative; font-size: 18px;
}
.chat-av .on {
    position: absolute; bottom: 0; right: 0; width: 12px; height: 12px; border-radius: 50%;
    background-color: var(--em-yellow); border: 2px solid var(--em-green-dark);
}
.chat-name { font-weight: 700; font-size: 16px; color: #fff; }
.chat-status { font-size: 13px; color: #fff; font-weight: 600; }
.chat-badge {
    margin-left: auto; font-size: 10px; font-weight: 700; color: #005c4b; background-color: #fff;
    border-radius: 5px; padding: 4px 8px; letter-spacing: .06em;
}
#em-chat-log {
    height: min(320px, 42vh);
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #fff;
    overscroll-behavior: contain;
}
#em-chat-log::-webkit-scrollbar { width: 6px; }
#em-chat-log::-webkit-scrollbar-thumb { background: var(--em-green); border-radius: 6px; }
.msg { display: flex; gap: 8px; max-width: 92%; }
.msg.out { align-self: flex-end; }
.msg .av {
    width: 28px; height: 28px; border-radius: 50%; background-color: var(--em-green-dark); color: #fff;
    display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: 0 0 auto;
}
.bub { font-size: 15px; line-height: 1.45; padding: 10px 14px; overflow-wrap: anywhere; }
.bub.in { background-color: #f1f1f1; border-radius: 4px 14px 14px 14px; color: #000; }
.bub.out { background-color: var(--em-green-dark); color: #fff; border-radius: 14px 4px 14px 14px; }
.bub .btn { font-size: 14px; }
.qp-wrap { padding: 10px 14px 4px; display: flex; flex-wrap: wrap; gap: 8px; background-color: #fff; }
.qp {
    font-size: 14px; font-weight: 600; color: var(--em-green-dark); border: 1px solid var(--em-green-dark);
    background: #fff; border-radius: 22px; padding: 8px 14px; min-height: 44px; cursor: pointer;
    transition: background-color .2s, color .2s; text-align: left;
}
.qp:hover { background-color: var(--em-green-dark); color: #fff; }
.chat-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid #e0e0e0; background-color: #fff; }
.chat-input input, .chat-input textarea {
    flex: 1; min-width: 0; min-height: 44px; border: 1px solid #767676; background: #f9f9f9;
    border-radius: 999px; padding: 10px 16px; font-size: 16px; color: #000;
}
.chat-input input:focus, .chat-input textarea:focus { border-color: var(--em-green-dark); }
.send {
    width: 44px; height: 44px; border-radius: 50%; background-color: var(--em-green-dark); color: #fff;
    border: none; display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; transition: background-color .2s;
}
.send:hover { background-color: #000; }
.dots span {
    display: inline-block; width: 6px; height: 6px; margin: 0 1.5px; background-color: var(--em-green-dark);
    border-radius: 50%; animation: blink 1.2s infinite both;
}
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-input textarea { resize: none; border-radius: 22px; line-height: 1.35; max-height: 120px; overflow-y: auto; font-family: inherit; }
.chat-input { align-items: flex-end; }
.send:disabled { opacity: .5; cursor: not-allowed; }
.send:disabled:hover { background-color: var(--em-green-dark); }
.chat-fab-wrap { position: fixed; right: 16px; bottom: 84px; z-index: 1009; display: flex; align-items: flex-end; gap: 10px; max-width: calc(100% - 24px); }
@media (min-width: 992px) { .chat-fab-wrap { bottom: 32px; right: 24px; flex-direction: column; align-items: flex-end; } }
.chat-fab { width: 56px; height: 56px; flex: 0 0 auto; border-radius: 50%; border: 0; background: var(--em-green-dark); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 18px rgba(0, 0, 0, .3); cursor: pointer; }
.chat-fab:hover { background: #000; }
.chat-teaser { display: flex; align-items: center; background: #fff; color: var(--ink); border: 1.5px solid var(--em-green-dark); border-radius: 16px 16px 4px 16px; box-shadow: 0 4px 18px rgba(0, 0, 0, .25); max-width: 260px; }
.chat-teaser[hidden] { display: none; }
.chat-teaser-open { background: none; border: 0; padding: 10px 4px 10px 14px; font: inherit; font-weight: 600; text-align: left; color: inherit; cursor: pointer; }
.chat-teaser-x { background: none; border: 0; width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; color: var(--ink); cursor: pointer; }
.chat-teaser-x .material-icons { font-size: 18px; }
.msg-choices, .msg-notice { align-self: stretch; }
.msg-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.msg-notice .bub { background: #fff8d6; border: 1px solid #c9a800; border-radius: 10px; font-size: 14px; color: #000; }
.msg-error .bub { background: #fdecea; border: 1px solid #b3261e; border-radius: 10px; color: #000; }
.bub p { margin: 0 0 .5em; } .bub p:last-child { margin-bottom: 0; }
.bub ul, .bub ol { margin: 0 0 .5em; padding-left: 1.2em; }
.bub a { color: #004d3d; font-weight: 600; }
.chat-cta { margin-top: 10px; }
.chat-closed .qp-wrap { display: none; }
.chat-api .qp-wrap { display: none; }
.calc-live-note { font-size: .9rem; }
.lead-form .is-invalid { border-color: #b3261e !important; }
.field-error { color: #9b1c15; font-size: .9rem; font-weight: 600; margin: 6px 0 0; }
.lead-form-msg { color: #9b1c15; font-weight: 600; margin: 0; }
.lead-calc-note { background: #fff; border: 1px dashed var(--em-green-dark); border-radius: 10px; padding: 10px 14px; margin: 0; font-size: .95rem; }
.lead-calc-note[hidden], .lead-success[hidden] { display: none; }
.lead-success { padding: clamp(18px, 3vw, 32px); }
.chat-consent { display: none; margin: 0; padding: 0 14px 10px; font-size: .8rem; color: #333; background: #fff; }
.chat-api .chat-consent { display: block; }
.chat-consent a { color: #004d3d; font-weight: 600; }
.w-100 { width: 100%; }
.chat-wrap { box-shadow: 0 .125rem .25rem rgba(0,0,0,.075); }
.chat-fab-wrap .chat-fab { position: static; }
.chat-teaser-x { color: var(--ink); }
.text-dark { color: #000 !important; }
@media (max-width: 991.98px) {
    /* the round chat button would sit on the consent row: hide it while the form is in view (home.js sets the class) */
    .chat-fab-wrap { transition: opacity .2s ease, visibility .2s ease; }
    .chat-fab-wrap.is-form-view { opacity: 0; visibility: hidden; pointer-events: none; }
}
