/**
 * Header Modal Styles
 */

/* Modal backdrop */
.header-modal {
    position: fixed;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.50);
    padding: 20px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.header-modal.is-visible {
    opacity: 1;
}

/* Modal container */
.header-modal__container {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 680px;
    max-height: calc(100vh - 40px);
    border-radius: 4px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.24);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.header-modal.is-visible .header-modal__container {
    transform: translateY(0);
}

/* Close button - positioned absolutely */
.header-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    opacity: 0.7;
    z-index: 1;
}

.header-modal__close:hover {
    opacity: 1;
}

.header-modal__close svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* Modal header */
.header-modal__header {
    padding: 48px 56px 0;
}

.header-modal__title {
    font-family: var(--cabb-font-heading);
    font-size: 32px;
    line-height: 1.25;
    font-weight: 600;
    margin: 0;
    padding-bottom: 16px;
}

/* Modal body */
.header-modal__body {
    flex: 1;
    padding: 0 56px 48px;
    overflow-y: auto;
}

.header-modal__content {
    font-size: 18px;
    line-height: 1.55;
    margin-bottom: 24px;
}

.header-modal__content:empty {
    display: none;
    margin-bottom: 0;
}

.header-modal__content p:first-child {
    margin-top: 0;
}

.header-modal__content p:last-child {
    margin-bottom: 0;
}

/* Text color variants */
.header-modal--text-light {
    color: #fff;
}

.header-modal--text-light .header-modal__close {
    color: #fff;
}

.header-modal--text-dark {
    color: #1D1D1D;
}

.header-modal--text-dark .header-modal__close {
    color: #1D1D1D;
}

/* Body scroll lock */
body.header-modal-open {
    overflow: hidden;
}

/**
 * Reset form block layout styles inside modal
 * (the HubSpot field styles are inherited from form block CSS)
 */
.header-modal .cabb-block.form {
    width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.header-modal .cabb-block.form .hubspot_form form > * {
    margin-bottom: 16px;
}

.header-modal .cabb-block.form .hubspot_form form > *:last-child {
    margin-bottom: 0;
}

/* Checkbox label alignment */
.header-modal .cabb-block.form .hubspot_form .hs-form-booleancheckbox-display {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: 0 !important;
}

.header-modal .cabb-block.form .hubspot_form .hs-form-booleancheckbox-display input[type="checkbox"] {
    flex-shrink: 0;
    margin: 4px 0 0 0;
}

.header-modal .cabb-block.form .hubspot_form .hs-form-booleancheckbox-display span {
    flex: 1;
}

/* Legal consent container */
.header-modal .cabb-block.form .hubspot_form .legal-consent-container {
    font-size: 14px;
    line-height: 1.5;
}

.header-modal .cabb-block.form .hubspot_form .legal-consent-container .hs-richtext {
    margin-bottom: 12px;
}

.header-modal .cabb-block.form .hubspot_form .legal-consent-container .hs-richtext:last-child {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 600px) {
    .header-modal {
        padding: 16px;
    }

    .header-modal__container {
        max-height: calc(100vh - 32px);
    }

    .header-modal__close {
        top: 12px;
        right: 12px;
    }

    .header-modal__header {
        padding: 40px 32px 0;
    }

    .header-modal__title {
        font-size: 24px;
    }

    .header-modal__body {
        padding: 20px 32px 32px;
    }
}
