/* ============================================================
   FAB Styles — Support + FAQ floating action buttons & modals
   Standalone stylesheet (no dependency on style.css)
   ============================================================ */

/* ============================================================
   SUPPORT FAB — Floating Action Button + Modal
   ============================================================ */
.support-fab {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: calc(24px + env(safe-area-inset-right, 0px));
    height: 48px;
    min-height: 44px;
    border-radius: 24px;
    background: linear-gradient(135deg, #000000 0%, #2563EB 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(27, 77, 138, 0.4);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px 0 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    animation: supportFadeIn 0.6s ease-out;
    font-family: 'Inter', 'DM Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.support-fab-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.support-fab::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 28px;
    border: 2px solid rgba(37, 99, 235, 0.35);
    animation: supportPulse 3s infinite;
    pointer-events: none;
}
.support-fab::after { display: none; }
.support-fab:hover {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(37, 99, 235, 0.45);
}
.support-fab:hover::before {
    animation: none;
    opacity: 0;
}
@keyframes supportPulse {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}
@keyframes supportFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.support-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 35, 50, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.support-overlay.visible { display: flex; }
.support-modal {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
}
.support-modal h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 6px;
    margin-top: 0;
}
.support-modal p {
    font-size: 13px;
    color: #60766F;
    margin-bottom: 16px;
    margin-top: 0;
}
.support-modal .text-input {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s;
}
.support-modal .text-input:focus { border-color: #2563EB; }
.support-modal .btn {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.support-modal .btn-filled {
    background: linear-gradient(135deg, #000000 0%, #2563EB 100%);
    color: #fff;
    margin-bottom: 8px;
}
.support-modal .btn-filled:hover {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
}
.support-modal .btn-outlined {
    background: transparent;
    color: #4B5563;
    border-color: #D1D5DB;
}
.support-modal .btn-outlined:hover {
    background: #F9FAFB;
}

/* ============================================================
   FAQ FAB — "Tire sua duvida" button (sits above Support FAB)
   ============================================================ */
.faq-fab {
    position: fixed;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px)); /* support 24 + 48 + 12 gap */
    right: calc(24px + env(safe-area-inset-right, 0px));
    height: 48px;
    min-height: 44px;
    border-radius: 24px;
    background: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(15, 118, 110, 0.4);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px 0 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    animation: faqFadeIn 0.7s ease-out;
    font-family: 'Inter', 'DM Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.faq-fab-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.faq-fab-label-short { display: none; }
.faq-fab:hover {
    background: linear-gradient(135deg, #14B8A6 0%, #2DD4BF 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(20, 184, 166, 0.5);
}
@keyframes faqFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* FAQ Overlay + Modal */
.faq-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 36, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 16px;
    animation: faqOverlayIn 0.25s ease-out;
}
.faq-overlay.visible { display: flex; }
@keyframes faqOverlayIn {
    from { opacity: 0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
}
.faq-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: faqModalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', 'DM Sans', sans-serif;
    position: relative;
    will-change: transform;
}
@keyframes faqModalIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.faq-modal-handle { display: none; } /* só aparece em mobile */
.faq-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
    color: #fff;
    flex-shrink: 0;
}
.faq-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.2px;
    color: #fff;
}
.faq-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.faq-close:hover { background: rgba(255, 255, 255, 0.28); }
.faq-modal-body {
    padding: 18px 22px 22px;
    overflow-y: auto;
    flex: 1;
    background: #fff;
    color: #1A1A1A;
}
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.faq-item {
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #FAFBFC;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
}
.faq-item:hover { border-color: #D1D5DB; }
.faq-item.open {
    border-color: #14B8A6;
    background: #fff;
}
.faq-q {
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    padding: 12px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: #1A1A1A;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: inherit;
    line-height: 1.4;
}
.faq-q span { flex: 1; }
.faq-chevron {
    flex-shrink: 0;
    color: #6B7280;
    transition: transform 0.25s ease;
}
.faq-item.open .faq-chevron {
    transform: rotate(180deg);
    color: #14B8A6;
}
.faq-a {
    max-height: 0;
    overflow: hidden;
    padding: 0 14px;
    font-size: 13px;
    color: #4B5563;
    line-height: 1.55;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-a {
    max-height: 600px;
    padding: 0 14px 14px;
}
.faq-a b { color: #1A1A1A; }
.faq-a ul {
    margin: 6px 0;
    padding-left: 20px;
}
.faq-a li { margin-bottom: 4px; }
.faq-section-divider {
    margin: 18px 0 10px;
    padding-top: 14px;
    border-top: 1px solid #E5E7EB;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #6B7280;
}
.faq-footer-hint {
    margin-top: 16px;
    padding: 10px 12px;
    background: #F0FDFA;
    border-left: 3px solid #14B8A6;
    border-radius: 6px;
    font-size: 12px;
    color: #115E59;
    line-height: 1.5;
}
.faq-footer-hint b { color: #0F766E; }

/* ============================================================
   Responsive breakpoints
   ============================================================ */

/* Tablet + mobile larger ===================================== */
@media (max-width: 680px) {
    .support-fab {
        height: 44px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        right: calc(16px + env(safe-area-inset-right, 0px));
        padding: 0 16px 0 14px;
        gap: 6px;
    }
    .support-fab svg { width: 18px; height: 18px; }
    .support-fab-label { font-size: 12px; }

    .faq-fab {
        height: 44px;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)); /* 16 + 44 + 12 */
        right: calc(16px + env(safe-area-inset-right, 0px));
        padding: 0 16px 0 14px;
        gap: 6px;
    }
    .faq-fab svg { width: 18px; height: 18px; }
    .faq-fab-label { font-size: 12px; }

    /* Centered card mode (no longer bottom sheet) ------------- */
    .faq-overlay {
        padding: 20px 16px;
        align-items: center;
        justify-content: center;
    }
    .faq-modal {
        max-height: 70vh;
        max-height: 70dvh;
        border-radius: 16px;
        width: 100%;
        max-width: 100%;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
        padding-top: 0;
    }
    .faq-modal-handle { display: none; }
    .faq-modal-header {
        padding: 16px 18px;
        position: sticky;
        top: 0;
        z-index: 1;
        border-radius: 16px 16px 0 0;
    }
    .faq-modal-header h3 { font-size: 16px; }
    .faq-modal-body {
        padding: 14px 16px 18px;
    }
    .faq-list { gap: 8px; }
    .faq-item { border-radius: 10px; }
    .faq-q {
        padding: 12px 12px;
        font-size: 13.5px;
        min-height: 44px;
        gap: 10px;
    }
    .faq-a {
        font-size: 13px;
        line-height: 1.55;
        padding: 0 12px;
    }
    .faq-item.open .faq-a {
        max-height: 1200px;
        padding: 0 12px 12px;
    }
    .faq-section-divider {
        font-size: 11px;
        margin: 16px 0 10px;
        padding-top: 12px;
    }
    .faq-footer-hint {
        font-size: 12px;
        padding: 10px 12px;
        margin-top: 14px;
        line-height: 1.5;
    }

    .support-modal { padding: 22px 20px; }
}

/* Small phones (iPhone SE, etc.) ============================= */
@media (max-width: 420px) {
    .faq-fab { padding: 0 14px 0 12px; gap: 5px; }
    .faq-fab-label-full { display: none; }
    .faq-fab-label-short { display: inline; }
    .support-fab { padding: 0 14px 0 12px; gap: 5px; }
}

/* Very small / narrow screens ================================ */
@media (max-width: 360px) {
    .faq-fab,
    .support-fab {
        padding: 0;
        gap: 0;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        justify-content: center;
    }
    .faq-fab-label,
    .support-fab-label { display: none; }
    .faq-fab { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
}

/* Landscape phones (short height) ============================ */
@media (max-height: 480px) and (orientation: landscape) {
    .support-fab,
    .faq-fab {
        height: 40px;
        min-height: 40px;
    }
    .support-fab {
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    .faq-fab {
        bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    }
    .faq-modal { max-height: 90vh; max-height: 90dvh; }
    .faq-overlay { padding: 8px; }
}

/* Tall phones (extra height available) ======================== */
@media (max-width: 680px) and (min-height: 800px) {
    .faq-modal {
        max-height: 62vh;
        max-height: 62dvh;
    }
}

/* Touch device: disable hover scale animation (sticky hover bug) */
@media (hover: none) {
    .faq-fab:hover,
    .support-fab:hover { transform: none; }
}
