/* Shared contact popup component */
.contact-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.contact-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.contact-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

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

.contact-popup-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 32px 24px 40px;
}

.contact-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.contact-popup-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    font-family: "Montserrat", sans-serif;
}

.contact-popup-title span {
    color: var(--mira-gold, #d9a963);
}

.contact-popup-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f8f8;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.contact-popup-close:hover {
    background: #e0e0e0;
}

.contact-popup-close .icon-svg {
    width: 20px;
    height: 20px;
    filter: none;
    opacity: 0.7;
}

.contact-popup-subtitle {
    font-size: 14px;
    color: #666666;
    margin-bottom: 24px;
    line-height: 1.6;
    font-family: "Montserrat", sans-serif;
}

.contact-popup-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-popup-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.contact-popup-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-popup-group.full {
    grid-column: 1 / -1;
}

.contact-popup-label {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    font-family: "Montserrat", sans-serif;
}

.contact-popup-input,
.contact-popup-select,
.contact-popup-textarea {
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-control, 6px);
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    background: #ffffff;
    transition: all 0.2s ease;
    width: 100%;
}

.contact-popup-input:focus,
.contact-popup-select:focus,
.contact-popup-textarea:focus {
    outline: none;
    border-color: var(--mira-gold, #d9a963);
    box-shadow: 0 0 0 3px rgba(var(--mira-gold-rgb, 217, 169, 99), 0.1);
}

.contact-popup-textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-popup-submit {
    padding: 16px 24px;
    background: var(--mira-gold, #d9a963);
    color: #ffffff;
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-control, 6px);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.contact-popup-submit:hover {
    background: var(--mira-gold-hover, #c99a55);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--mira-gold-rgb, 217, 169, 99), 0.3);
}

.contact-popup-submit:disabled {
    cursor: wait;
    opacity: 0.68;
    transform: none;
    box-shadow: none;
}

.contact-popup-status {
    margin-top: -4px;
}

.contact-popup-expand-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: "Montserrat", sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #666666;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.contact-popup-expand-toggle:hover {
    color: #1a1a1a;
}

.contact-popup-expand-toggle .icon-svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.contact-popup-expand-toggle.expanded .icon-svg {
    transform: rotate(180deg);
}

.contact-popup-expand-fields {
    display: none;
    gap: 16px;
}

.contact-popup-expand-fields.visible {
    display: grid;
    grid-template-columns: 1fr 1fr;
    animation: contactPopupFadeUp 0.3s ease forwards;
}

@keyframes contactPopupFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.contact-popup-footer {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

.contact-popup-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: "Montserrat", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--mira-gold, #d9a963);
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-popup-footer-link:hover {
    color: var(--mira-gold-hover, #c99a55);
}

.contact-popup-footer-link .icon-svg {
    width: 14px;
    height: 14px;
    filter: invert(58%) sepia(23%) saturate(1005%) hue-rotate(353deg)
        brightness(90%) contrast(86%);
}

body.theme-hr .contact-popup-footer-link .icon-svg {
    filter: invert(15%) sepia(14%) saturate(1887%) hue-rotate(81deg)
        brightness(92%) contrast(91%);
}

@media (max-width: 600px) {
    .contact-popup-row,
    .contact-popup-expand-fields.visible {
        grid-template-columns: 1fr;
    }

    .contact-popup-container {
        padding: 24px 20px 32px;
    }

    .contact-popup-title {
        font-size: 20px;
    }
}

@media print {
    .contact-popup,
    .contact-popup-overlay {
        display: none !important;
    }
}
