/* ============================================
   HubSpot Forms Styling
   602 Marketing - Premium Form Integration
   
   IMPORTANT: HubSpot forms render inside iframes.
   Button colors, fonts, etc. must be styled in
   HubSpot's form editor, not here. This CSS only
   styles the CONTAINERS around the forms.
   ============================================ */

/* Form Section Containers */
.hubspot-form-section {
    padding: 80px 20px;
    background: linear-gradient(180deg, #f9fafb 0%, #ffffff 100%);
}

.hubspot-form-section.alternate-bg {
    background: #f9fafb;
}

.hubspot-form-container {
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    padding: 48px 40px;
    border-radius: 20px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 30px -5px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.hubspot-form-header {
    text-align: center;
    margin-bottom: 32px;
}

.hubspot-form-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    line-height: 1.3;
}

.hubspot-form-header p {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

/* HubSpot Form Frame - Just the container */
.hs-form-frame {
    min-height: 300px;
    width: 100%;
    position: relative;
}

/* Hide Loading text once form loads */
.hs-form-frame.loaded::before {
    display: none !important;
}

/* No loading text - forms appear quickly enough */
.hs-form-frame::before {
    content: '';
}

/* Make HubSpot iframes responsive */
.hs-form-frame iframe {
    width: 100% !important;
    border: none !important;
}

/* ============================================
   Modal Styling
   ============================================ */

.hubspot-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hubspot-modal.active {
    display: flex;
    opacity: 1;
}

.hubspot-modal-content {
    background: #ffffff;
    border-radius: 20px;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.hubspot-modal.active .hubspot-modal-content {
    transform: scale(1);
}

.hubspot-modal-header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.hubspot-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 40px 8px 0;
}

.hubspot-modal-header p {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.hubspot-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #6b7280;
    transition: all 0.2s ease;
}

.hubspot-modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.hubspot-modal-body {
    padding: 32px;
}

/* ============================================
   Two-Step Form Flow
   ============================================ */

.two-step-form-container {
    max-width: 700px;
    margin: 0 auto;
}

.form-step {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-step.active {
    display: block;
    opacity: 1;
}

.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    gap: 16px;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: all 0.3s ease;
}

.step-dot.active {
    width: 40px;
    border-radius: 6px;
    background: var(--blue, #2563eb);
}

.step-dot.completed {
    background: #10b981;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .hubspot-form-section {
        padding: 50px 16px;
    }

    .hubspot-form-container {
        padding: 28px 20px;
        border-radius: 16px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    }

    .hubspot-form-header {
        margin-bottom: 24px;
    }

    .hubspot-form-header h2 {
        font-size: 1.4rem;
        line-height: 1.3;
        margin-bottom: 10px;
    }

    .hubspot-form-header p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* HubSpot Form Frame - Mobile */
    .hs-form-frame {
        min-height: 280px;
    }

    .hubspot-modal-content {
        border-radius: 16px;
        max-height: 90vh;
        margin: 10px;
    }

    .hubspot-modal-header {
        padding: 20px 20px 16px;
    }

    .hubspot-modal-header h3 {
        font-size: 1.2rem;
        margin-right: 36px;
    }

    .hubspot-modal-header p {
        font-size: 0.9rem;
    }

    .hubspot-modal-body {
        padding: 20px;
    }

    .hubspot-modal-close {
        width: 36px;
        height: 36px;
        top: 16px;
        right: 16px;
        font-size: 20px;
    }

    /* Two-step form mobile improvements */
    .two-step-form-container {
        max-width: 100%;
    }

    .step-indicator {
        margin-bottom: 28px;
        gap: 12px;
    }

    .step-dot {
        width: 10px;
        height: 10px;
    }

    .step-dot.active {
        width: 32px;
    }

    .form-step h2 {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }

    .form-step p {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .hubspot-form-section {
        padding: 40px 12px;
    }

    .hubspot-form-container {
        padding: 24px 16px;
        border-radius: 14px;
    }

    .hubspot-form-header h2 {
        font-size: 1.25rem;
        letter-spacing: -0.3px;
    }

    .hubspot-form-header p {
        font-size: 0.85rem;
    }

    .hubspot-modal {
        padding: 8px;
        align-items: flex-end;
    }

    .hubspot-modal-content {
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        margin: 0;
    }

    .hubspot-modal-header {
        padding: 18px 16px 14px;
    }

    .hubspot-modal-header h3 {
        font-size: 1.1rem;
    }

    .hubspot-modal-body {
        padding: 16px;
    }

    .hubspot-modal-close {
        width: 32px;
        height: 32px;
        top: 14px;
        right: 14px;
        font-size: 18px;
    }

    /* Form step mobile refinements */
    .step-indicator {
        margin-bottom: 24px;
    }

    .form-step h2 {
        font-size: 1.15rem;
    }

    .form-step p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

/* Extra small screens (below 360px) */
@media (max-width: 360px) {
    .hubspot-form-container {
        padding: 20px 14px;
    }

    .hubspot-form-header h2 {
        font-size: 1.15rem;
    }

    .hubspot-modal-header h3 {
        font-size: 1rem;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error fallback message */
.hubspot-error-message {
    text-align: center;
    padding: 40px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #991b1b;
    font-size: 0.95rem;
    line-height: 1.6;
}

.hubspot-error-message strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 8px;
}