/* ========================================
   Email Gate Popup – Marbos Audit
   ======================================== */

/* --- Overlay --- */
.eg-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 37, 64, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

.eg-overlay.eg-visible {
    opacity: 1;
    visibility: visible;
}

.eg-overlay.eg-hiding {
    opacity: 0;
    visibility: visible;
}

/* --- Popup card --- */
.eg-popup {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(7, 11, 23, 0.18),
                0 0 0 1px rgba(226, 232, 240, 0.5);
    position: relative;
    overflow: hidden;
    transform: scale(0.94) translateY(12px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.eg-overlay.eg-visible .eg-popup {
    transform: scale(1) translateY(0);
}

.eg-overlay.eg-hiding .eg-popup {
    transform: scale(0.94) translateY(12px);
}

/* Gradient top stripe (matches .audit-form-card::before) */
.eg-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #635bff, #00d4ff);
    opacity: 0.9;
}

/* --- Shake feedback --- */
@keyframes egShake {
    0%, 100% { transform: scale(1) translateY(0) translateX(0); }
    20%      { transform: scale(1) translateY(0) translateX(-6px); }
    40%      { transform: scale(1) translateY(0) translateX(6px); }
    60%      { transform: scale(1) translateY(0) translateX(-4px); }
    80%      { transform: scale(1) translateY(0) translateX(3px); }
}

.eg-popup.eg-shake {
    animation: egShake 0.45s ease-in-out;
}

/* --- Inner content --- */
.eg-inner {
    padding: 36px 32px 32px;
}

/* --- Step: Form --- */
.eg-step--form,
.eg-step--thanks {
    text-align: center;
}

.eg-step--thanks {
    display: none;
}

/* Icon */
.eg-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 20px;
    border-radius: 14px;
    background: rgba(99, 91, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #635bff;
}

.eg-icon svg {
    width: 26px;
    height: 26px;
}

/* Heading */
.eg-heading {
    font-family: 'Sora', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0A2540;
    letter-spacing: -0.025em;
    line-height: 1.3;
    margin-bottom: 8px;
}

.eg-subtext {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* --- Email form --- */
.eg-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.eg-email-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 0.9375rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f7f8fc;
    color: #0f172a;
    outline: none;
    transition: border-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.eg-email-input::placeholder {
    color: #64748b;
}

.eg-email-input:focus {
    border-color: #635bff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.22);
}

.eg-email-input.eg-has-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* Submit button */
.eg-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #635bff 0%, #4f46e5 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.18s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

.eg-submit-btn:hover {
    background: linear-gradient(135deg, #5248e6 0%, #4338ca 100%);
    box-shadow: 0 8px 28px rgba(99, 91, 255, 0.35);
}

.eg-submit-btn:active {
    transform: scale(0.98);
}

.eg-submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.eg-submit-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Error text */
.eg-email-error {
    display: none;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #dc2626;
    text-align: center;
    margin-top: -4px;
}

/* Consent text */
.eg-consent {
    font-size: 0.6875rem;
    color: #64748b;
    line-height: 1.6;
    margin-top: 16px;
    text-align: center;
}

.eg-consent a {
    color: #635bff;
    text-decoration: underline;
    text-decoration-color: rgba(99, 91, 255, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.18s;
}

.eg-consent a:hover {
    text-decoration-color: #635bff;
}

/* --- Step: Thank you --- */
.eg-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.05);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #475569;
    font-size: 0;
    transition: background 0.18s, color 0.18s;
}

.eg-close-btn:hover {
    background: rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

.eg-close-btn svg {
    width: 16px;
    height: 16px;
}

.eg-thanks-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #ecfdf5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #059669;
}

.eg-thanks-icon svg {
    width: 28px;
    height: 28px;
}

.eg-thanks-heading {
    font-family: 'Sora', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0A2540;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.eg-thanks-text {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
}

/* Fade-in for the thanks step */
@keyframes egFadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.eg-step--thanks.eg-active {
    display: block;
    animation: egFadeInUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .eg-overlay {
        padding: 16px;
        align-items: flex-end;
    }

    .eg-popup {
        max-width: 100%;
        border-radius: 18px 18px 0 0;
    }

    .eg-inner {
        padding: 28px 20px 24px;
    }

    .eg-heading {
        font-size: 1.125rem;
    }
}
