﻿/* =====================================================
   POPUP OVERLAY
   ===================================================== */

.popupOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: rgba(0,0,0,0.45);
    padding: 48px;
    overscroll-behavior: contain;
}

body.popupOpen {
    overflow: hidden;
}

/* =====================================================
   POPUP WRAPPER
   ===================================================== */

.popupWrapper {
    width: 650px;
    max-width: 92vw;
    margin-top: 60px;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    background: #f6f7f6;
    border-radius: 16px;
    padding: 44px 48px;
}

    .popupWrapper h2 {
        color: var(--color-accent);
        margin-bottom: 26px;
    }

/* =====================================================
   POPUP CONTENT
   ===================================================== */

.popupScroll {
    overflow: visible;
    max-height: none;
    padding-bottom: 48px;
    scrollbar-width: none;
}

    .popupScroll::-webkit-scrollbar {
        display: none;
    }

/* =====================================================
   FORM GRID
   ===================================================== */

.formGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 28px;
}

.formFull {
    grid-column: 1 / span 2;
}

@media (max-width:700px) {

    .popupOverlay {
        padding: 20px;
    }

    .popupWrapper {
        margin: 20px auto;
        padding: 28px 24px;
    }

    .formGrid {
        grid-template-columns: 1fr;
    }

    .formFull {
        grid-column: auto;
    }
}

/* =====================================================
   FORM ELEMENTS
   ===================================================== */

.formInput,
.formTextarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #ddd;
    font-size: 15px;
}

.formTextarea {
    min-height: 130px;
}

    .formInput:focus,
    .formTextarea:focus {
        outline: none;
        border-color: #ddd;
        box-shadow: 0 0 0 2px rgba(29,168,130,.15);
    }

/* validation */

.formInput.invalid, 
.formInput.modified.invalid {
    border-color: #e5484d !important;
    background: #fff6f6;
    box-shadow: 0 0 0 2px rgba(229,72,77,.12);
}

.formInput.valid,
.formInput.modified.valid {
    border-color: #ddd !important;
    background: #ffffff;
}

.validation-message {
    margin-top: 6px;
    font-size: 13px;
    color: #e5484d;
}

/* =====================================================
   MICROCOPY
   ===================================================== */

.contactMicrocopy {
    margin-top: 6px;
    margin-bottom: 6px;
    opacity: .75;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.sendButton {
    width: 100%;
    height: 52px;
    background: #111;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(0,0,0,0.18);
    cursor: pointer;
    transition: all 0.15s ease;
}

    .sendButton:hover {
        background: #1b1b1b;
        box-shadow: 0 5px 14px rgba(0,0,0,0.25);
    }

.sendHint {
    margin-top: 8px;
    text-align: center;
    font-size: 13px;
    color: #777;
}

/* =====================================================
   FORM HELPERS
   ===================================================== */

.hpField {
    display: none;
}

.formActions {
    position: sticky;
    bottom: 0;
    background: transparent;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* =====================================================
   SPINNER
   ===================================================== */

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: white;
    border-radius: 50%;
    display: inline-block;
    animation: spin .6s linear infinite;
    margin-right: 6px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
