/* AEU Content Gate - Modal Styling (CrossX-IT Brand) */

/* ─── Overlay ──────────────────────────────────────────────── */

.aeu-cg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(47, 58, 63, 0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.aeu-cg-overlay.aeu-cg-active {
    opacity: 1;
    visibility: visible;
}

/* ─── Modal Card ───────────────────────────────────────────── */

.aeu-cg-modal {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    max-width: 560px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.3s ease;
    border-top: 4px solid #ff8300;
}

.aeu-cg-active .aeu-cg-modal {
    transform: translateY(0) scale(1);
}

/* ─── Header Bar ───────────────────────────────────────────── */

.aeu-cg-header {
    background: #2f3a3f;
    padding: 20px 28px;
    border-radius: 8px 8px 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
    flex-shrink: 0;
}

.aeu-cg-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #ff8300;
    border-radius: 8px;
    margin-bottom: 10px;
}

.aeu-cg-header-icon svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;
}

.aeu-cg-header-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
}

/* ─── Close Button ─────────────────────────────────────────── */

.aeu-cg-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    font-size: 20px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.aeu-cg-close:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* ─── Body / Message ───────────────────────────────────────── */

.aeu-cg-body {
    padding: 24px 28px 28px;
    overflow-y: auto;
    flex: 1;
}

.aeu-cg-message {
    font-size: 15px;
    line-height: 1.6;
    color: #2f3a3f;
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ebebeb;
}

/* ─── HubSpot Form Container ──────────────────────────────── */

#aeu-cg-hubspot-form {
    min-height: 80px;
}

/* HubSpot form overrides to match brand */
#aeu-cg-hubspot-form .hs-form {
    max-width: 100%;
}

#aeu-cg-hubspot-form .hs-form fieldset {
    max-width: 100% !important;
}

#aeu-cg-hubspot-form .hs-form .hs-input {
    width: 100% !important;
    border: 1px solid #c0c0c0;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    color: #2f3a3f;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#aeu-cg-hubspot-form .hs-form .hs-input:focus {
    border-color: #ff8300;
    box-shadow: 0 0 0 3px rgba(255, 131, 0, 0.15);
    outline: none;
}

#aeu-cg-hubspot-form .hs-form label {
    font-size: 13px;
    font-weight: 600;
    color: #2f3a3f;
    margin-bottom: 4px;
}

#aeu-cg-hubspot-form .hs-form .hs-submit .actions {
    text-align: center;
    padding-top: 12px;
}

#aeu-cg-hubspot-form .hs-form .hs-button {
    background: #ff8300;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    width: 100%;
    letter-spacing: 0.02em;
}

#aeu-cg-hubspot-form .hs-form .hs-button:hover {
    background: #e67600;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 131, 0, 0.35);
}

#aeu-cg-hubspot-form .hs-form .hs-button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* HubSpot error messages */
#aeu-cg-hubspot-form .hs-form .hs-error-msgs {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

/* HubSpot iframe form (direct embed with reCAPTCHA) */
#aeu-cg-hubspot-form iframe {
    width: 100% !important;
    min-height: 400px;
    border: none !important;
    display: block;
    transition: height 0.2s ease;
}

/* ─── Powered-by footer ────────────────────────────────────── */

.aeu-cg-footer {
    text-align: center;
    padding: 0 28px 16px;
    font-size: 11px;
    color: #6b7280;
}

/* ─── Scrollbar ────────────────────────────────────────────── */

.aeu-cg-modal::-webkit-scrollbar {
    width: 6px;
}

.aeu-cg-modal::-webkit-scrollbar-track {
    background: transparent;
}

.aeu-cg-modal::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

.aeu-cg-modal::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* ─── Cookie Consent Warning ──────────────────────────────── */

.aeu-cg-consent-warning {
    text-align: center;
    padding: 24px 16px;
}

.aeu-cg-consent-icon {
    margin-bottom: 16px;
}

.aeu-cg-consent-title {
    font-size: 17px;
    font-weight: 700;
    color: #2f3a3f;
    margin: 0 0 8px;
}

.aeu-cg-consent-text {
    font-size: 14px;
    line-height: 1.6;
    color: #6b7280;
    margin: 0 0 20px;
}

.aeu-cg-consent-text strong {
    color: #2f3a3f;
}

.aeu-cg-consent-btn {
    background: #ff8300;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    width: 100%;
    margin-bottom: 10px;
}

.aeu-cg-consent-btn:hover {
    background: #e67600;
}

.aeu-cg-retry-btn {
    background: transparent;
    color: #2f3a3f;
    border: 1px solid #c0c0c0;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease;
    width: 100%;
}

.aeu-cg-retry-btn:hover {
    border-color: #ff8300;
    color: #ff8300;
}

/* ─── Ensure reCAPTCHA elements appear above the overlay ──── */

.grecaptcha-badge {
    z-index: 10000000 !important;
}

/* Google reCAPTCHA challenge overlay and iframe */
body > div[style*="z-index"] > div > iframe[src*="recaptcha"],
body > div[style*="z-index"] > div > iframe[src*="google.com"] {
    z-index: 10000000 !important;
}

/* ─── Responsive ───────────────────────────────────────────── */

@media (max-width: 640px) {
    .aeu-cg-modal {
        width: calc(100% - 24px);
        margin: 12px;
        max-height: 95vh;
        border-radius: 10px;
    }

    .aeu-cg-header {
        padding: 16px 20px;
    }

    .aeu-cg-header-title {
        font-size: 16px;
    }

    .aeu-cg-body {
        padding: 20px;
    }

    .aeu-cg-message {
        font-size: 14px;
    }
}
