/* ============================================
   Floating draggable inquiry button + form
   ============================================ */
.iq-fab {
    position: fixed; z-index: 1100;
    left: 0; top: 0;                      /* real position is set by JS */
    display: inline-flex; align-items: center; gap: 8px;
    height: 48px; padding: 0 18px 0 16px; border-radius: 60px; border: none;
    background: var(--gradient-primary); color: white;
    font-family: inherit; font-size: 0.9rem; font-weight: 600;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    cursor: grab; user-select: none; -webkit-user-select: none;
    touch-action: none;                   /* lets us drag on phones without scrolling */
    visibility: hidden;                   /* shown once JS has positioned it */
    transition: transform 0.2s, box-shadow 0.2s;
}
.iq-fab.ready { visibility: visible; }
.iq-fab.snapping { transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), top 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.2s; }
.iq-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(139, 92, 246, 0.55); }
.iq-fab.dragging { cursor: grabbing; transform: scale(1.06); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); transition: none; }
.iq-fab i { font-size: 1.05rem; }
.iq-fab::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.6);
    animation: iqPulse 2.4s infinite;
    pointer-events: none;
}
.iq-fab.dragging::before, .iq-open .iq-fab::before { animation: none; }
@keyframes iqPulse {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.55); }
    70% { box-shadow: 0 0 0 14px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}
.iq-fab-hint {
    position: absolute; bottom: calc(100% + 10px); right: 0;
    padding: 6px 10px; border-radius: 8px;
    background: #111827; color: #e5e7eb; font-size: 0.72rem; font-weight: 500; white-space: nowrap;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    opacity: 0; transform: translateY(4px); pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}
.iq-fab.on-left .iq-fab-hint { right: auto; left: 0; }
.iq-fab-hint.show { opacity: 1; transform: none; }

/* ---------- Overlay + dialog ---------- */
.iq-overlay {
    position: fixed; inset: 0; z-index: 1200;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(5, 7, 12, 0.65);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: iqFade 0.2s ease;
}
.iq-overlay[hidden] { display: none; }
@keyframes iqFade { from { opacity: 0; } }
.iq-dialog {
    width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow-y: auto;
    border-radius: 24px;
    background: linear-gradient(180deg, #171c28, #10141c);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    animation: iqUp 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@keyframes iqUp { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.iq-open { overflow: hidden; }

.iq-head { display: flex; gap: 14px; align-items: flex-start; padding: 22px 22px 6px; }
.iq-head-icon {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--gradient-primary); color: white;
}
.iq-head h3 { font-size: 1.2rem; margin-bottom: 2px; }
.iq-head p { color: var(--text-mute); font-size: 0.86rem; }
.iq-close {
    margin-left: auto; width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    border: 1px solid var(--border); background: transparent; color: var(--text-soft); cursor: pointer;
}
.iq-close:hover { color: white; background: rgba(255, 255, 255, 0.06); }

.iq-form { padding: 14px 22px 22px; }
.iq-interest { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.iq-interest label { cursor: pointer; }
.iq-interest input { position: absolute; opacity: 0; pointer-events: none; }
.iq-interest span {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 12px; border-radius: 60px;
    border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft); font-size: 0.8rem; font-weight: 500;
    transition: all 0.2s;
}
.iq-interest span i { color: var(--text-mute); font-size: 0.75rem; }
.iq-interest input:checked + span { border-color: rgba(139, 92, 246, 0.7); background: rgba(139, 92, 246, 0.18); color: white; }
.iq-interest input:checked + span i { color: #c4b5fd; }
.iq-interest input:focus-visible + span { outline: 2px solid #a78bfa; outline-offset: 2px; }

.iq-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.iq-field { margin-bottom: 12px; }
.iq-field label { display: block; font-size: 0.8rem; color: var(--text-soft); margin-bottom: 6px; font-weight: 500; }
.iq-field input, .iq-field textarea {
    width: 100%; padding: 11px 14px; border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(0, 0, 0, 0.3);
    color: white; font-family: inherit; font-size: 0.92rem; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.iq-field textarea { resize: vertical; min-height: 84px; }
.iq-field input:focus, .iq-field textarea:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2); }
.iq-field input::placeholder, .iq-field textarea::placeholder { color: var(--text-mute); }
.iq-error { display: none; color: #f87171; font-size: 0.75rem; margin-top: 4px; }
.iq-field.invalid input, .iq-field.invalid textarea { border-color: #ef4444; }
.iq-field.invalid .iq-error { display: block; }

.iq-submit { width: 100%; margin-top: 4px; padding: 13px 20px; }
.iq-note { text-align: center; color: var(--text-mute); font-size: 0.75rem; margin-top: 10px; }

.iq-success { padding: 30px 26px 30px; text-align: center; }
.iq-success-icon {
    width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(16, 185, 129, 0.15); color: #34d399; font-size: 1.6rem;
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.08);
    animation: iqUp 0.4s ease;
}
.iq-success h3 { font-size: 1.3rem; margin-bottom: 6px; }
.iq-success p { color: var(--text-soft); margin-bottom: 20px; font-size: 0.92rem; }

/* ---------- Phone ---------- */
@media (max-width: 640px) {
    .iq-fab {
        height: 44px; min-width: 44px; padding: 0; justify-content: center;
        transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s, box-shadow 0.2s;
    }
    .iq-fab-label { display: none; }
    .iq-fab i { font-size: 1.1rem; }
    .iq-fab-hint { display: none; }
    /* Half-hidden at the screen edge */
    .iq-fab.tucked { opacity: 0.85; box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35); }
    .iq-fab.tucked.on-right { transform: translateX(calc(50% + 16px)); }
    .iq-fab.tucked.on-left { transform: translateX(calc(-50% - 16px)); }
    .iq-fab.tucked.on-right i { margin-right: 50%; }
    .iq-fab.tucked.on-left i { margin-left: 50%; }
    .iq-fab.tucked::before { animation: none; }
    /* Fully shown after a tap (or hover on devices with a mouse) */
    .iq-fab.expanded { padding: 0 16px 0 14px; opacity: 1; }
    .iq-fab.expanded .iq-fab-label { display: inline; }
    .iq-fab.expanded:hover { transform: none; }
    .iq-overlay { align-items: flex-end; padding: 0; }
    .iq-dialog {
        max-width: none; max-height: 92vh;
        border-radius: 22px 22px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
        animation: iqSheet 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    @keyframes iqSheet { from { transform: translateY(100%); } }
    .iq-row { grid-template-columns: 1fr; gap: 0; }
    .iq-head { padding: 18px 18px 4px; }
    .iq-form { padding: 12px 18px 18px; }
    .iq-field input, .iq-field textarea { font-size: 16px; } /* stops iOS zoom on focus */
}
@media (max-width: 640px) and (hover: hover) {
    .iq-fab.tucked:hover { transform: none; opacity: 1; }
    .iq-fab.tucked:hover i { margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .iq-fab::before { animation: none; }
}

/* Hide while the phone menu is open */
.menu-open .iq-fab { display: none; }

/* Honeypot field (bots fill it, people never see it) */
.iq-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- One-field-at-a-time inquiry wizard ---------- */
.iq-wizard-panel[hidden] { display: none; }
.iq-wizard-panel.active { animation: iqStepFade 0.25s ease; }
@keyframes iqStepFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
.iq-step-prompt { color: var(--text-soft); font-size: 0.95rem; margin-bottom: 16px; }
.iq-wizard-nav {
    display: flex; gap: 12px; justify-content: space-between;
    margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.iq-wizard-nav .btn { flex: 1; }
.iq-wizard-nav [hidden] { display: none; }
.iq-form-error { color: #fca5a5; font-size: 0.82rem; margin-top: 12px; }
.iq-form-error[hidden] { display: none; }
