/* Floating widgets: chatbot (left) and WhatsApp (right), plus the home-page lead form. */

.floating-widget {
    position: fixed;
    bottom: 20px;
    z-index: 9990;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.floating-widget--chat {
    left: 20px;
}
.floating-widget--whatsapp {
    right: 20px;
}

.fw-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}
.fw-button:hover,
.fw-button:focus-visible {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.3);
}
.fw-button svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}
.fw-button--chat {
    background: #1f4fa3;
    color: #ffffff;
}
.fw-button--whatsapp {
    background: #25d366;
    color: #ffffff;
}
.fw-button:focus-visible {
    outline: 3px solid #9bbcf0;
    outline-offset: 3px;
}

/* Chat panel */
.chat-panel {
    position: absolute;
    left: 0;
    bottom: 74px;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 480px;
    max-height: calc(100vh - 120px);
    display: none;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e3e7ef;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}
.chat-panel.is-open {
    display: flex;
}
.chat-header {
    background: #1f4fa3;
    color: #ffffff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.chat-header strong {
    display: block;
    font-size: 16px;
}
.chat-header small {
    opacity: 0.85;
    font-size: 12px;
}
.chat-header button {
    background: transparent;
    border: 0;
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.chat-header button:focus-visible {
    outline: 2px solid #ffffff;
    border-radius: 4px;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f5f7fb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-msg {
    max-width: 85%;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-line;
    word-wrap: break-word;
}
.chat-msg--bot {
    background: #ffffff;
    border: 1px solid #e3e7ef;
    align-self: flex-start;
    color: #1d2433;
}
.chat-msg--user {
    background: #1f4fa3;
    color: #ffffff;
    align-self: flex-end;
}
.chat-msg--error {
    background: #fef3f2;
    border-color: #fecdca;
    color: #b42318;
}
.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 10px;
    background: #f5f7fb;
}
.chat-options button {
    border: 1px solid #1f4fa3;
    background: #ffffff;
    color: #1f4fa3;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}
.chat-options button:hover,
.chat-options button:focus-visible {
    background: #1f4fa3;
    color: #ffffff;
}
.chat-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e3e7ef;
    background: #ffffff;
}
.chat-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid #c9d0dc;
    border-radius: 8px;
    padding: 9px 11px;
    font: inherit;
    font-size: 14px;
}
.chat-form input:focus {
    outline: 3px solid #9bbcf0;
    outline-offset: 1px;
}
.chat-form button {
    border: 0;
    background: #1f4fa3;
    color: #ffffff;
    border-radius: 8px;
    padding: 0 14px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.chat-form button:disabled {
    opacity: 0.6;
    cursor: default;
}
.chat-footer {
    padding: 8px 12px 10px;
    font-size: 12px;
    text-align: center;
    background: #ffffff;
    border-top: 1px solid #f0f2f6;
}
.chat-footer a {
    color: #128c4a;
    font-weight: 600;
}

/* Home-page lead form */
.lead-section {
    background: #f5f7fb;
}
.lead-form {
    background: #ffffff;
    border: 1px solid #e3e7ef;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.lead-form label {
    display: block;
    font-weight: 600;
    margin: 12px 0 6px;
    font-size: 14px;
}
.lead-form input,
.lead-form select,
.lead-form textarea {
    width: 100%;
    border: 1px solid #c9d0dc;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    font-size: 15px;
    background: #ffffff;
}
.lead-form textarea {
    min-height: 110px;
    resize: vertical;
}
.lead-form input:focus,
.lead-form select:focus,
.lead-form textarea:focus {
    outline: 3px solid #9bbcf0;
    outline-offset: 1px;
}
.lead-form .lead-error {
    color: #b42318;
    font-size: 13px;
    margin-top: 4px;
}
.lead-form .lead-status {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}
.lead-form .lead-status.is-success {
    display: block;
    background: #ecfdf3;
    color: #137a3a;
    border: 1px solid #a6e8bf;
}
.lead-form .lead-status.is-error {
    display: block;
    background: #fef3f2;
    color: #b42318;
    border: 1px solid #fecdca;
}
.lead-form .lead-submit {
    margin-top: 20px;
    background: #1f4fa3;
    color: #ffffff;
    border: 0;
    border-radius: 8px;
    padding: 13px 26px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.lead-form .lead-submit:hover {
    background: #173b7a;
}
.lead-form .lead-submit:disabled {
    opacity: 0.6;
    cursor: default;
}
.lead-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 575px) {
    .floating-widget--chat {
        left: 12px;
        bottom: 12px;
    }
    .floating-widget--whatsapp {
        right: 12px;
        bottom: 12px;
    }
    .chat-panel {
        bottom: 68px;
        height: min(70vh, 520px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fw-button {
        transition: none;
    }
    .fw-button:hover,
    .fw-button:focus-visible {
        transform: none;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
