/* ═══════════════════════════════════════════════════════════════
   Happy House Service Pro – style.css  v3.0
   Premium popup form – fully responsive (mobile-first)
═══════════════════════════════════════════════════════════════ */

/* ── Google Font (loaded via @import for self-contained delivery) ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Reset & scroll lock ─────────────────────────────────────── */
body.hh-no-scroll {
    overflow: hidden;
}

/* ── Overlay ─────────────────────────────────────────────────── */
#hh-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(10, 15, 30, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 16px;
    overflow-y: auto;
    /* Flex to vertically center the box */
    align-items: flex-start;
    justify-content: center;
}

/* When visible jQuery sets display:block — we override to flex */
#hh-popup-overlay[style*="display: block"],
#hh-popup-overlay[style*="display:block"] {
    display: flex !important;
}

/* ── Popup box ───────────────────────────────────────────────── */
.hh-popup-box {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 580px;
    margin: auto;
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    animation: hhSlideUp 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes hhSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ── Header ──────────────────────────────────────────────────── */
.hh-popup-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px 20px;
    background: linear-gradient(135deg, #f5a800 0%, #e8950a 100%);
    position: relative;
}

.hh-popup-header-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.hh-popup-header h2 {
    margin: 0 0 2px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.hh-popup-subtitle {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.4;
}

.hh-popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.hh-popup-close:hover {
    background: rgba(255, 255, 255, 0.38);
}

/* ── Body ────────────────────────────────────────────────────── */
.hh-popup-body {
    padding: 24px;
}

/* ── Two-column row ──────────────────────────────────────────── */
.hh-form-row.hh-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Form group ──────────────────────────────────────────────── */
.hh-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.hh-form-group > label,
.hh-form-group > .hh-form-group-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.hh-req {
    color: #ef4444;
    margin-left: 2px;
}

.hh-optional {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.78rem;
}

/* ── Inputs, selects, textareas ──────────────────────────────── */
.hh-form-group input,
.hh-form-group select,
.hh-form-group textarea {
    font-family: inherit;
    font-size: 0.9rem;
    color: #111827;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.hh-form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.hh-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.hh-form-group input:focus,
.hh-form-group select:focus,
.hh-form-group textarea:focus {
    border-color: #f5a800;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(245, 168, 0, 0.18);
}

.hh-form-group input::placeholder,
.hh-form-group textarea::placeholder {
    color: #b0b8c8;
}

/* Error state */
.hh-form-group input.hh-input-error,
.hh-form-group select.hh-input-error,
.hh-form-group textarea.hh-input-error {
    border-color: #ef4444;
    background: #fff5f5;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* ── Inline error messages ───────────────────────────────────── */
.hh-error {
    display: none;
    font-size: 0.76rem;
    color: #ef4444;
    margin-top: 4px;
    font-weight: 500;
}

/* ── Alert box ───────────────────────────────────────────────── */
#hh-form-alert {
    display: none;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.87rem;
    font-weight: 500;
    margin-bottom: 14px;
    line-height: 1.5;
}

#hh-form-alert.hh-alert-success {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

#hh-form-alert.hh-alert-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* ── Submit button ───────────────────────────────────────────── */
.hh-submit-btn {
    font-family: inherit;
    width: 100%;
    padding: 13px 24px;
    font-size: 0.97rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #1a1100;
    background: linear-gradient(135deg, #f5a800 0%, #e8950a 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
    box-shadow: 0 4px 16px rgba(245, 168, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.hh-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 168, 0, 0.5);
}

.hh-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.hh-submit-btn:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

/* Spinner animation */
.hh-spin {
    animation: hhSpin 0.8s linear infinite;
}

@keyframes hhSpin {
    to { transform: rotate(360deg); }
}

/* ── Service chip groups ─────────────────────────────────────── */
.hh-chip-section {
    margin-top: 10px;
}

.hh-chip-section + .hh-chip-section {
    margin-top: 8px;
}

.hh-chip-category {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin: 0 0 7px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hh-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.hh-chip {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 100px;
    padding: 6px 13px;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.15s;
    line-height: 1.3;
    white-space: nowrap;
}

.hh-chip:hover {
    border-color: #f5a800;
    background: #fff9ec;
    color: #92600a;
    transform: translateY(-1px);
}

.hh-chip.hh-chip--selected {
    background: linear-gradient(135deg, #f5a800 0%, #e8950a 100%);
    border-color: #e8950a;
    color: #1a1100;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(245, 168, 0, 0.35);
    transform: translateY(-1px);
}

/* ── Cleaning service pill-buttons ───────────────────────────── */
.hh-checkbox-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 5px !important;
    margin-top: 6px !important;
}

.hh-checkbox-label {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    color: #374151 !important;
    cursor: pointer !important;
    padding: 6px 5px !important;
    min-height: 42px !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 8px !important;
    background: #f9fafb !important;
    transition: border-color 0.18s, background 0.18s, color 0.18s, box-shadow 0.18s !important;
    user-select: none !important;
    position: relative !important;
    line-height: 1.2 !important;
    margin-bottom: 0 !important;
    letter-spacing: normal !important;
}

.hh-checkbox-label:not(.hh-cb-active):hover {
    border-color: #f5a800 !important;
    background: #fff9ec !important;
    color: #92600a !important;
}

/* Hide native browser checkbox completely */
.hh-checkbox-label input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
}

/* Selected (active) state — set by JavaScript */
.hh-checkbox-label.hh-cb-active {
    background: linear-gradient(135deg, #f5a800 0%, #e8950a 100%) !important;
    border-color: #e8950a !important;
    color: #1a1100 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(245, 168, 0, 0.4) !important;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
═══════════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 640 px) ───────────────────────────────────────── */
@media (max-width: 640px) {
    .hh-form-row.hh-two-col {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .hh-checkbox-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .hh-popup-header {
        padding: 18px 16px 16px;
        gap: 10px;
    }

    .hh-popup-header h2 {
        font-size: 1.05rem;
    }

    .hh-popup-subtitle {
        font-size: 0.78rem;
    }

    .hh-popup-body {
        padding: 18px 16px;
    }

    .hh-popup-header-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        border-radius: 10px;
    }
}

/* ── Small mobile (≤ 400 px) ─────────────────────────────────── */
@media (max-width: 400px) {
    .hh-popup-box {
        border-radius: 16px;
    }

    .hh-popup-header h2 {
        font-size: 1rem;
    }

    .hh-form-group input,
    .hh-form-group select,
    .hh-form-group textarea {
        font-size: 0.88rem;
        padding: 9px 12px;
    }

    .hh-checkbox-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .hh-submit-btn {
        font-size: 0.93rem;
        padding: 12px 18px;
    }
}

/* ── Very tall popup on short screens ────────────────────────── */
@media (max-height: 700px) {
    #hh-popup-overlay {
        align-items: flex-start;
    }

    .hh-popup-box {
        margin: 10px auto 20px;
    }
}
