/* MuntMogul Cognito Forms Professional Styling */

/* ===== COGNITO FORMS MODAL OVERLAY ===== */
.cognito-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cognito-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.cognito-modal-container {
    background: var(--white, #FFFFFF);
    border-radius: var(--radius-xl, 1rem);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cognito-modal-overlay.active .cognito-modal-container {
    transform: translateY(0) scale(1);
}

/* ===== MODAL HEADER ===== */
.cognito-modal-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--light-gray, #F8FAFC);
    background: var(--light-gray, #F8FAFC);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cognito-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-blue, #1E3A8A);
    margin: 0;
    font-family: var(--font-family, 'Inter', sans-serif);
}

.cognito-modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius-md, 0.5rem);
    color: var(--medium-gray, #64748B);
    transition: all var(--transition-fast, 0.15s ease);
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cognito-modal-close:hover {
    background: var(--primary-blue, #3B82F6);
    color: var(--white, #FFFFFF);
}

/* ===== MODAL BODY ===== */
.cognito-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: var(--white, #FFFFFF);
}

/* ===== COGNITO FORMS CUSTOM STYLING ===== */
/* Target the iframe container */
.cognito-form-container {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
}

.cognito-form-container iframe {
    border: none;
    width: 100%;
    border-radius: 0;
}

/* ===== COGNITO FORM CSS VARIABLES OVERRIDE ===== */
/* These will be applied to the embedded form */
[data-cognito-form] {
    --primary-color: #3B82F6 !important;
    --primary-dark: #1E3A8A !important;
    --accent-color: #FBBF24 !important;
    --success-color: #22C55E !important;
    --error-color: #DC2626 !important;
    --text-color: #334155 !important;
    --background-color: #FFFFFF !important;
    --border-color: #E2E8F0 !important;
    --border-radius: 0.5rem !important;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .cognito-modal-container {
        max-width: 100%;
        margin: 10px;
        max-height: calc(100vh - 20px);
        border-radius: var(--radius-lg, 0.75rem);
    }
    
    .cognito-modal-header {
        padding: 16px;
    }
    
    .cognito-modal-title {
        font-size: 1.25rem;
    }
    
    .cognito-modal-close {
        width: 28px;
        height: 28px;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .cognito-modal-overlay {
        padding: 8px;
    }

    .cognito-modal-container {
        margin: 0;
        border-radius: var(--radius-md, 0.5rem);
        max-height: calc(100vh - 16px);
    }

    .cognito-modal-header {
        padding: 12px 16px;
    }

    .cognito-modal-title {
        font-size: 1.125rem;
    }

    .cognito-modal-close {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
}

/* ===== ULTRA-SMALL DEVICES (375px and below) ===== */
@media (max-width: 375px) {
    .cognito-modal-overlay {
        padding: 4px;
    }

    .cognito-modal-container {
        max-height: calc(100vh - 8px);
        border-radius: var(--radius-sm, 0.375rem);
    }

    .cognito-modal-header {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .cognito-modal-title {
        font-size: 1rem;
        line-height: 1.3;
    }

    .cognito-modal-close {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    /* Touch-friendly form elements */
    .cognito-form-container iframe {
        min-height: 350px;
    }

    .cognito-loading {
        padding: 40px 16px;
        min-height: 350px;
    }

    .cognito-spinner {
        width: 28px;
        height: 28px;
        border-width: 2px;
        margin-right: 8px;
    }
}

/* ===== VERY SMALL DEVICES (320px and below) ===== */
@media (max-width: 320px) {
    .cognito-modal-container {
        max-height: calc(100vh - 4px);
    }

    .cognito-modal-header {
        padding: 8px 10px;
    }

    .cognito-modal-title {
        font-size: 0.9rem;
        max-width: calc(100% - 40px);
    }

    .cognito-modal-close {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .cognito-form-container iframe {
        min-height: 300px;
    }

    .cognito-loading {
        padding: 30px 12px;
        min-height: 300px;
        font-size: 0.875rem;
    }

    .cognito-spinner {
        width: 24px;
        height: 24px;
        margin-right: 6px;
    }
}

/* ===== LOADING ANIMATION ===== */
.cognito-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--medium-gray, #64748B);
    font-family: var(--font-family, 'Inter', sans-serif);
}

.cognito-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--light-gray, #F8FAFC);
    border-top: 3px solid var(--primary-blue, #3B82F6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== PROFESSIONAL ENHANCEMENTS ===== */
.cognito-modal-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.1) 0%, 
        rgba(30, 58, 138, 0.1) 100%);
    pointer-events: none;
}

/* Smooth entrance animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cognito-modal-container.animate-in {
    animation: slideInUp 0.3s ease forwards;
}

/* ===== CUSTOM BUTTON STYLES FOR MODAL TRIGGERS ===== */
.partnership-form-btn {
    position: relative;
    overflow: hidden;
}

.partnership-form-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.5s ease;
}

.partnership-form-btn:hover::after {
    left: 100%;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.cognito-modal-overlay[aria-hidden="true"] {
    display: none !important;
}

.cognito-modal-close:focus {
    outline: 2px solid var(--primary-blue, #3B82F6);
    outline-offset: 2px;
}

/* ===== PROFESSIONAL FORM STYLING WITHIN IFRAME ===== */
/* These styles will be injected into the Cognito Form */
.cognito-professional-theme {
    --cog-primary-color: #3B82F6;
    --cog-primary-hover: #1E3A8A;
    --cog-accent-color: #FBBF24;
    --cog-success-color: #22C55E;
    --cog-error-color: #DC2626;
    --cog-text-color: #334155;
    --cog-border-color: #E2E8F0;
    --cog-background: #FFFFFF;
    --cog-font-family: 'Inter', system-ui, sans-serif;
    --cog-border-radius: 0.5rem;
    --cog-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --cog-transition: 0.15s ease;
}

/* ===== ADDITIONAL IFRAME ENHANCEMENTS ===== */
/* Ensure iframes load properly and handle errors gracefully */
.cognito-form-container iframe {
    min-height: 400px;
    background: var(--white, #FFFFFF);
    transition: opacity 0.3s ease;
}

.cognito-form-container iframe[src] {
    opacity: 1;
}

/* Loading enhancement for better UX */
.cognito-loading {
    min-height: 400px;
    background: var(--light-gray, #F8FAFC);
}

/* Error state styling */
.cognito-form-error {
    padding: 40px;
    text-align: center;
    background: var(--light-gray, #F8FAFC);
    color: var(--medium-gray, #64748B);
    border-radius: var(--radius-lg, 0.75rem);
    margin: 20px;
}

.cognito-form-error h3 {
    color: var(--dark-blue, #1E3A8A);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.cognito-form-error p {
    font-size: 0.9rem;
    line-height: 1.5;
}