/* ============================================
   CONTACT POPUP STYLES
   ============================================ */

.contact-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.contact-popup-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.contact-popup-content {
    width: 100%;
    max-width: 600px;
    background: #0f0f13;
    /* Fallback */
    background: linear-gradient(145deg, #13131a 0%, #0f0f13 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    /* Prevent overflow on small screens */
}

.contact-popup-overlay.active .contact-popup-content {
    transform: translateY(0);
}

.contact-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s;
    line-height: 1;
}

.contact-popup-close:hover {
    color: white;
}

/* 
   --------------------------------------------------
   IMPORTED & ADAPTED FORM STYLES (from contact.css)
   --------------------------------------------------
*/

/* Form Layout */
.popup-form-card {
    padding: 24px;
    /* Compact padding */
    overflow-y: auto;
    overflow-x: hidden;
    /* Allow scrolling if content is tall */
}

/* Header Compactness */
.contact-popup-content .form-card-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
}

.contact-popup-content .form-card-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
}

.contact-popup-content .form-card-header p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Progress Steps */
#popupFormProgress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 24px;
    padding: 0 10px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.progress-step .step-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    transition: all 0.3s;
}

.progress-step.active .step-number,
.progress-step.completed .step-number {
    background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.progress-step .step-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-step.active .step-label {
    color: #d8b4fe;
    font-weight: 600;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    max-width: 60px;
}

/* Option Cards (Radio Buttons) */
.popup-step-header {
    text-align: center;
    margin-bottom: 20px;
}

.popup-step-header h3 {
    font-size: 18px;
    margin-bottom: 4px;
    color: white;
}

.popup-step-header p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.popup-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.project-option input,
.budget-option input {
    display: none;
}

.option-card {
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    /* Slight increase for better spacing */
    position: relative;
    overflow: hidden;
}

.option-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.option-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.option-card:hover::before {
    opacity: 0.1;
}

.project-option input:checked+.option-card {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.15);
    box-shadow:
        0 0 0 1px rgba(139, 92, 246, 0.3),
        0 8px 20px rgba(139, 92, 246, 0.2);
    transform: translateY(-3px);
}

.project-option input:checked+.option-card::before {
    opacity: 0.2;
}

.option-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
}

.option-icon svg {
    width: 20px;
    height: 20px;
}

.project-option input:checked+.option-card .option-icon {
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    color: white;
}

.option-card h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: white;
}

.option-card p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* Budget Options */
.budget-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.budget-option {
    flex: 1;
    min-width: 100px;
}

.budget-card {
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 90px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.budget-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.budget-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.budget-card:hover::before {
    opacity: 0.1;
}

.budget-option input:checked+.budget-card {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.15);
    box-shadow:
        0 0 0 1px rgba(139, 92, 246, 0.3),
        0 8px 20px rgba(139, 92, 246, 0.2);
    transform: translateY(-3px);
}

.budget-option input:checked+.budget-card::before {
    opacity: 0.2;
}

.budget-amount {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 2px;
}

.budget-label {
    font-size: 10px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: inline-block;
}

/* Inputs */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    transition: all 0.3s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-textarea {
    min-height: 80px;
    resize: none;
}

/* Multi-step Visibility Logic */
.form-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Actions */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: nowrap;
}

.btn {
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
    color: white;
    /* Allow flexible width */
    flex: 1;
    min-width: 0;
    /* Prevent overflow */
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    /* Fixed or intrinsic width for back button */
    flex: 0 0 auto;
    min-width: 80px;
    padding: 10px 20px;
}

.btn-outline:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* Success State */
#popupFormSuccess {
    display: none;
    text-align: center;
    padding: 30px 20px;
}

#popupFormSuccess.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ═══════════════════════════════════════════════════════════════
   POPUP MOBILE RESPONSIVE STYLES
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 576px) {

    /* Popup container adjustments */
    .contact-popup-overlay {
        padding: 10px;
    }

    .contact-popup-content {
        max-width: 100%;
        border-radius: 20px;
        max-height: 95vh;
    }

    /* Form card padding */
    .popup-form-card {
        padding: 16px;
    }

    /* Header adjustments */
    .contact-popup-content .form-card-header {
        padding: 15px 15px 12px;
        margin-bottom: 15px;
    }

    .contact-popup-content .form-card-header h2 {
        font-size: 20px;
    }

    .contact-popup-content .form-card-header p {
        font-size: 12px;
    }

    /* Progress steps compact */
    #popupFormProgress {
        gap: 8px;
        margin-bottom: 16px;
    }

    .progress-step .step-number {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .progress-step .step-label {
        font-size: 9px;
    }

    .progress-line {
        max-width: 40px;
    }

    /* Options grid - two columns on mobile */
    .popup-options {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .option-card {
        min-height: 100px;
        padding: 10px;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
    }

    .option-icon {
        margin-bottom: 6px;
        width: 32px;
        height: 32px;
    }

    /* Budget options - grid lookup */
    .budget-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .budget-option:last-child {
        grid-column: 1 / -1;
    }

    .budget-card {
        min-height: 80px;
        flex-direction: column;
        gap: 4px;
        justify-content: center;
    }

    /* Form actions - stack buttons vertically */
    .form-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .form-actions .btn {
        width: 100%;
        max-width: 100%;
        justify-content: center;
    }

    .form-actions .btn-primary {
        flex: none;
    }

    .form-actions .btn-outline {
        flex: none;
        min-width: 100%;
    }

    /* Input fields */
    .form-input,
    .form-textarea {
        padding: 10px 14px;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .form-textarea {
        min-height: 100px;
    }

    /* Close button - bigger touch target */
    .contact-popup-close {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
    }
}

@media (max-width: 400px) {
    .contact-popup-content .form-card-header h2 {
        font-size: 18px;
    }

    .progress-step .step-label {
        display: none;
    }

    .budget-amount {
        font-size: 13px;
    }

    .budget-label {
        font-size: 9px;
    }
}