/* ========================================
   Email Modal Styles
   ======================================== */

/* Modal Dialog */
#slideUpModal .modal-dialog {
    max-width: 560px;
}

.email-modal-content {
    border: none;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* Dynamic Gradient Background */
.email-modal-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0c1460 0%, #0a0f45 25%, #5a67d4 50%, #0c1460 75%, #0a0f45 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: 0;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Gradient Waves */
.gradient-wave {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.7;
    animation: waveFloat 20s ease-in-out infinite;
}

.wave-1 {
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.3);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.wave-2 {
    width: 450px;
    height: 450px;
    background: rgba(12, 20, 96, 0.4);
    bottom: -150px;
    left: -150px;
    animation-delay: 7s;
}

.wave-3 {
    width: 400px;
    height: 400px;
    background: rgba(12, 20, 96, 0.4);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes waveFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    33% {
        transform: translate(50px, -50px) scale(1.15) rotate(120deg);
    }
    66% {
        transform: translate(-40px, 40px) scale(0.9) rotate(240deg);
    }
}

/* Gradient Orbs */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: orbPulse 8s ease-in-out infinite;
}

.orb-1 {
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.4);
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 150px;
    height: 150px;
    background: rgba(12, 20, 96, 0.5);
    bottom: 15%;
    left: 15%;
    animation-delay: 2.5s;
}

.orb-3 {
    width: 120px;
    height: 120px;
    background: rgba(12, 20, 96, 0.5);
    top: 60%;
    right: 20%;
    animation-delay: 5s;
}

@keyframes orbPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
}

/* Animated Border */
.email-modal-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 32px;
    padding: 2px;
    background: linear-gradient(135deg, #0c1460, #0a0f45, #5a67d4, #0c1460, #0a0f45);
    background-size: 300% 300%;
    animation: borderRotate 8s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 1;
    opacity: 0.6;
}

@keyframes borderRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Glow Effect */
.email-modal-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
    animation: glowRotate 20s linear infinite;
    z-index: 0;
}

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

/* Close Button */
.email-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 30;
    width: 44px;
    height: 44px;
    opacity: 1;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(12, 20, 96, 0.2);
    padding: 0;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0c1460;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.email-modal-close:hover {
    background: linear-gradient(135deg, #0c1460, #0a0f45);
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 8px 30px rgba(12, 20, 96, 0.5);
    border-color: transparent;
}

.email-modal-close svg {
    width: 18px;
    height: 18px;
}

/* Badge */
.email-modal-badge {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 3;
}

.email-modal-badge span {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, rgba(12, 20, 96, 0.15), rgba(12, 20, 96, 0.15));
    border: 1.5px solid rgba(12, 20, 96, 0.3);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    color: #0c1460;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(12, 20, 96, 0.2);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(12, 20, 96, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(12, 20, 96, 0.35);
    }
}

/* Icon Section */
.email-modal-icon-wrapper {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 3;
}

.icon-glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border: 3px solid rgba(12, 20, 96, 0.3);
    border-radius: 50%;
    animation: ringPulse 3s ease-out infinite;
}

@keyframes ringPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.3;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0;
    }
}

.email-modal-icon {
    display: inline-flex;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #0c1460 0%, #0c1460 50%, #0a0f45 100%);
    border-radius: 26px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 40px rgba(12, 20, 96, 0.4), 0 0 0 8px rgba(12, 20, 96, 0.1);
    animation: iconFloat 4s ease-in-out infinite;
    position: relative;
    z-index: 2;
    transform: rotate(-3deg);
}

.email-modal-icon svg {
    width: 52px;
    height: 52px;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0) rotate(-3deg) scale(1);
    }
    50% {
        transform: translateY(-10px) rotate(3deg) scale(1.05);
    }
}

/* Header */
.email-modal-header {
    text-align: center;
    margin-bottom: 36px;
    padding: 0;
    position: relative;
    z-index: 3;
}

.email-modal-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 14px 0;
}

.title-line-1,
.title-line-2 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -1px;
}

.title-line-1 {
    background: linear-gradient(135deg, #0c1460 0%, #0a0f45 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-line-2 {
    background: linear-gradient(135deg, #0c1460 0%, #0a0f45 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.email-modal-subtitle {
    font-size: 15px;
    color: #64748b;
    margin: 0;
    line-height: 1.7;
    font-weight: 500;
}

/* Form */
.email-form-group {
    margin-bottom: 24px;
    position: relative;
    z-index: 3;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 18px;
    color: #0c1460;
    z-index: 1;
    pointer-events: none;
    transition: all 0.3s ease;
}

.email-form-input {
    width: 100%;
    padding: 17px 18px 17px 52px;
    border: 2.5px solid rgba(12, 20, 96, 0.2);
    border-radius: 16px;
    font-size: 15px;
    color: #1e293b;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: "Montserrat", sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.email-form-input:focus {
    border-color: #0c1460;
    outline: none;
    box-shadow: 0 0 0 5px rgba(12, 20, 96, 0.15), 0 8px 28px rgba(12, 20, 96, 0.25);
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.98);
}

.email-form-input:focus + .input-shine,
.input-wrapper:focus-within .input-shine {
    opacity: 1;
}

.email-form-input::placeholder {
    color: #94a3b8;
}

.input-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
    opacity: 0;
    border-radius: 16px;
}

.email-form-input:focus ~ .input-shine {
    left: 100%;
    opacity: 1;
}

/* Submit Button */
.email-submit-btn {
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, #0c1460 0%, #0c1460 50%, #0a0f45 100%);
    background-size: 200% 200%;
    animation: buttonGradient 5s ease infinite;
    border: none;
    color: #ffffff;
    font-weight: 800;
    font-size: 17px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 20px;
    font-family: "Montserrat", sans-serif;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(12, 20, 96, 0.4);
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes buttonGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.email-submit-btn:hover .btn-shine {
    left: 100%;
}

.email-submit-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(12, 20, 96, 0.5);
}

.email-submit-btn:active {
    transform: translateY(-2px) scale(1);
    box-shadow: 0 8px 25px rgba(12, 20, 96, 0.4);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-arrow {
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.email-submit-btn:hover .btn-arrow {
    transform: translateX(8px);
}

/* Footer */
.email-modal-footer-text {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
    position: relative;
    z-index: 3;
    line-height: 1.6;
}

/* Modal Body */
.email-modal-content .modal-body {
    padding: 48px 44px 42px;
    position: relative;
    z-index: 3;
}

/* Alerts */
.email-modal-content .alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid rgba(16, 185, 129, 0.3);
    color: #065f46;
    border-radius: 14px;
    padding: 16px 20px;
    font-size: 14px;
    margin-bottom: 26px;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.2);
    backdrop-filter: blur(10px);
}

.email-modal-content .alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: #991b1b;
    border-radius: 14px;
    padding: 16px 20px;
    font-size: 14px;
    margin-bottom: 26px;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.2);
    backdrop-filter: blur(10px);
}

/* Modal Entrance Animation */
#slideUpModal.modal.fade .modal-dialog {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
    transform: translateY(80px) scale(0.88);
    opacity: 0;
}

#slideUpModal.modal.show .modal-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ========================================
   Modal Theme Overrides
   ======================================== */

:root {
    --brand-primary: #0c1460;
    --brand-secondary: #0c1460;
    --brand-accent: #0a0f45;
    --text-strong: #0f172a;
    --text-muted: #64748b;
    --surface: #ffffff;
    --border: rgba(15, 23, 42, 0.08);
}

.email-modal-bg,
.gradient-wave,
.gradient-orb,
.email-modal-border,
.email-modal-glow {
    display: none !important;
}

#slideUpModal .modal-dialog {
    padding: 0;
}

/* Refined theme overrides */
.email-modal-content {
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.email-modal-close {
    width: 36px;
    height: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--brand-primary);
    box-shadow: none;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.email-modal-close:hover {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    transform: scale(1.05);
}

.email-modal-close:active {
    transform: scale(0.95);
}

.email-modal-badge span {
    padding: 6px 14px;
    background: rgba(12, 20, 96, 0.08);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    color: var(--brand-primary);
    box-shadow: none;
    animation: none;
}

.email-modal-icon {
    width: 84px;
    height: 84px;
    background: rgba(12, 20, 96, 0.08);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: none;
}

.email-modal-icon svg {
    width: 46px;
    height: 46px;
}

.title-line-1,
.title-line-2 {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
    color: var(--text-strong);
    -webkit-text-fill-color: initial;
    background: none;
}

.email-modal-subtitle {
    color: var(--text-muted);
}

.email-form-input {
    padding: 14px 16px 14px 48px;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: none;
    background: var(--surface);
    color: var(--text-strong);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.email-form-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
    background: var(--surface);
}

.input-shine {
    display: none !important;
}

.email-submit-btn {
    padding: 14px 24px;
    background: var(--brand-primary);
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
}

.email-submit-btn:hover {
    background: #0a0f45;
}

.btn-shine {
    display: none !important;
}

.email-modal-content .modal-body {
    padding: 36px 32px 30px;
}

/* ========================================
   Mobile Responsive Styles
   ======================================== */

@media (max-width: 576px) {
    #slideUpModal .modal-dialog {
        width: 90vw;
        max-width: 90vw;
        margin: 4vh auto;
        height: auto;
        max-height: 75vh;
    }

    .email-modal-content {
        border-radius: 20px;
        height: auto;
        display: flex;
        flex-direction: column;
    }

    .email-modal-content .modal-body {
        padding: 14px 14px 12px;
        display: block;
        height: auto;
        overflow-y: auto;
    }

    .email-modal-badge {
        margin-bottom: 10px;
    }

    .email-modal-badge span {
        font-size: 10px;
        padding: 5px 12px;
    }

    .email-modal-icon-wrapper {
        margin-bottom: 12px;
    }

    .icon-glow-ring {
        width: 80px;
        height: 80px;
    }

    .email-modal-icon {
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }

    .email-modal-icon svg {
        width: 32px;
        height: 32px;
    }

    .email-modal-header {
        margin-bottom: 14px;
    }

    .title-line-1,
    .title-line-2 {
        font-size: 17px;
    }

    /* Hide subtitle on mobile to reduce vertical space */
    .email-modal-subtitle {
        display: none;
    }

    .email-form-group {
        margin-bottom: 12px;
    }

    .email-form-input {
        padding: 12px 14px 12px 42px;
        font-size: 13px;
        border-radius: 12px;
    }

    .input-icon {
        left: 14px;
        width: 18px;
        height: 18px;
    }

    .email-submit-btn {
        padding: 13px 20px;
        font-size: 14px;
        margin-bottom: 12px;
        border-radius: 12px;
    }

    .email-modal-footer-text {
        font-size: 10px;
        line-height: 1.4;
    }

    .gradient-wave {
        filter: blur(60px);
    }

    .wave-1 {
        width: 300px;
        height: 300px;
    }

    .wave-2 {
        width: 250px;
        height: 250px;
    }

    .wave-3 {
        width: 200px;
        height: 200px;
    }

    .gradient-orb {
        filter: blur(40px);
    }

    .email-modal-close {
        width: 38px;
        height: 38px;
        top: 16px;
        right: 16px;
        border-radius: 12px;
    }

    .email-modal-close svg {
        width: 16px;
        height: 16px;
    }

    .email-modal-border {
        border-radius: 24px;
    }
}
