/* ============================================
   CONTACT PANEL -- Slide-up consultation form
   Fixed bottom overlay with backdrop blur
   ============================================ */

/* --- Overlay backdrop --- */
.contact-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(10, 47, 82, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 450ms cubic-bezier(0.22, 1, 0.36, 1),
                visibility 450ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.contact-panel-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* --- Panel container --- */
.contact-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2001;
    height: 88vh;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
}

/* --- Drag handle (mobile swipe target) --- */
.contact-panel__handle {
    width: 40px;
    height: 4px;
    background: rgba(10, 47, 82, 0.15);
    border-radius: 2px;
    margin: 12px auto 0;
    flex-shrink: 0;
    cursor: grab;
}

/* --- Close button (top-right X) --- */
.contact-panel__close {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 10;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #0a2f52;
    opacity: 0.4;
    transition: opacity 200ms ease;
    padding: 8px;
    line-height: 1;
}

.contact-panel__close:hover {
    opacity: 1;
}

/* --- Scrollable content area --- */
.contact-panel__scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2.5rem 3rem 3rem;
    -webkit-overflow-scrolling: touch;
}

/* --- Header --- */
.contact-panel__title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    color: #0a2f52;
    line-height: 1.2;
    margin: 0 0 0.75rem 0;
}

.contact-panel__subtitle {
    font-family: 'Telegraf', 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #4c6786;
    line-height: 1.55;
    margin: 0 0 2.5rem 0;
    max-width: 520px;
}

/* --- Form section dividers --- */
.contact-panel__section {
    margin-bottom: 2rem;
}

.contact-panel__legend {
    font-family: 'Telegraf', 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0a2f52;
    margin-bottom: 0.75rem;
}

/* --- Radio group (engagement type) --- */
.contact-panel__radio-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.contact-panel__radio-option {
    background: rgba(247, 245, 238, 0.6);
    border: 1px solid rgba(10, 47, 82, 0.08);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: border-color 300ms ease, background 300ms ease;
    font-family: 'Telegraf', 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: #0a2f52;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.contact-panel__radio-option:hover {
    border-color: rgba(10, 47, 82, 0.2);
}

.contact-panel__radio-option.selected {
    border-color: #db4a2b;
    background: rgba(219, 74, 43, 0.04);
}

.contact-panel__radio-option input[type="radio"] {
    display: none;
}

/* Validation error state */
.contact-panel__radio-group.error {
    outline: 2px solid rgba(219, 74, 43, 0.5);
    outline-offset: 4px;
    border-radius: 10px;
}

/* --- Input rows --- */
.contact-panel__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.contact-panel__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-panel__label {
    font-family: 'Telegraf', 'Inter', sans-serif;
    font-size: 0.6875rem;
    color: #4c6786;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Text inputs, selects, textareas --- */
.contact-panel__input,
.contact-panel__select,
.contact-panel__textarea {
    font-family: 'Telegraf', 'Inter', sans-serif;
    font-size: 0.875rem;
    border: 1px solid rgba(10, 47, 82, 0.12);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: #1C1C1E;
    background: #ffffff;
    transition: border-color 300ms ease;
    width: 100%;
    box-sizing: border-box;
}

.contact-panel__input:focus,
.contact-panel__select:focus,
.contact-panel__textarea:focus {
    border-color: #0a2f52;
    outline: none;
}

.contact-panel__input.error,
.contact-panel__select.error,
.contact-panel__textarea.error {
    border-color: #db4a2b;
}

.contact-panel__textarea {
    min-height: 120px;
    resize: vertical;
}

.contact-panel__select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234c6786' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* --- Submit button --- */
.contact-panel__submit {
    background: #0a2f52;
    color: #f4ebd0;
    font-family: 'Telegraf', 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: none;
    border-radius: 6px;
    padding: 0.875rem 2.5rem;
    cursor: pointer;
    transition: background 300ms ease, transform 150ms ease;
    margin-top: 0.5rem;
}

.contact-panel__submit:hover {
    background: #0d3a66;
    transform: translateY(-1px);
}

.contact-panel__submit:active {
    transform: translateY(0);
}

/* --- Footer note --- */
.contact-panel__footer-note {
    font-family: 'Telegraf', 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #4c6786;
    opacity: 0.6;
    font-style: italic;
    margin-top: 1.5rem;
}

/* --- Success state --- */
.contact-panel__success {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 2rem;
}

.contact-panel__success h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: #0a2f52;
    margin: 0 0 1rem 0;
}

.contact-panel__success p {
    font-family: 'Telegraf', 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #4c6786;
    line-height: 1.6;
    margin: 0 0 0.5rem 0;
    max-width: 480px;
}

/* --- Body scroll lock --- */
body.contact-panel-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* ============================================
   RESPONSIVE: Tablet (<=1200px)
   ============================================ */
@media (max-width: 1200px) {
    .contact-panel__scroll {
        padding: 2rem 2rem 2.5rem;
    }
}

/* ============================================
   RESPONSIVE: Mobile (<=768px)
   ============================================ */
@media (max-width: 768px) {
    .contact-panel {
        height: 92vh;
        border-radius: 12px 12px 0 0;
    }

    .contact-panel__scroll {
        padding: 1.5rem 1.25rem 2rem;
    }

    .contact-panel__radio-group {
        grid-template-columns: 1fr;
    }

    .contact-panel__row {
        grid-template-columns: 1fr;
    }

    .contact-panel__close {
        top: 14px;
        right: 16px;
    }

    .contact-panel__title {
        font-size: 1.5rem;
    }

    .contact-panel__subtitle {
        margin-bottom: 1.75rem;
    }
}

/* ============================================
   RESPONSIVE: Small phone (<=480px)
   ============================================ */
@media (max-width: 480px) {
    .contact-panel {
        height: 94vh;
    }

    .contact-panel__scroll {
        padding: 1.25rem 1rem 1.5rem;
    }

    .contact-panel__title {
        font-size: 1.35rem;
    }

    .contact-panel__submit {
        width: 100%;
    }

    .contact-panel__section {
        margin-bottom: 1.5rem;
    }
}
