/* ============================================
   EMAIL COLLECTION MODAL
   ============================================ */

/* Modal Overlay */
.email-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.email-modal.active {
    display: flex;
}

.email-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

/* Modal Content Container */
.email-modal-content {
    position: relative;
    background: var(--white);
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
    z-index: 10001;
    /* Smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
}

/* Close Button */
.email-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(10, 22, 40, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--navy);
    cursor: pointer;
    transition: var(--transition);
    z-index: 10002;
}

.email-modal-close:hover {
    background: rgba(10, 22, 40, 0.2);
    transform: rotate(90deg);
}

/* Modal Body */
.email-modal-body {
    padding: 50px 40px 40px;
}

/* Icon */
.email-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--teal), var(--teal-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 36px;
    color: var(--white);
    box-shadow: 0 10px 30px rgba(20, 184, 166, 0.3);
}

/* Title & Subtitle */
.email-modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: var(--navy);
    text-align: center;
    margin-bottom: 15px;
}

.email-modal-subtitle {
    text-align: center;
    color: var(--navy-light);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.email-modal-subtitle strong {
    color: var(--teal);
    font-weight: 600;
}

/* Form Styles */
.email-form {
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--navy);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    color: var(--navy);
    transition: var(--transition);
    background: #f9fafb;
}

.form-input:focus {
    outline: none;
    border-color: var(--teal);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-error {
    display: block;
    color: #ef4444;
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
}

/* Checkbox */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 25px;
}

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--teal);
}

.form-checkbox label {
    flex: 1;
    font-size: 14px;
    color: var(--navy-light);
    line-height: 1.5;
    cursor: pointer;
    user-select: none;
}

/* Submit Button */
.btn-block {
    width: 100%;
    justify-content: center;
}

/* Success Message */
.email-success {
    text-align: center;
    padding: 20px 0;
    /* Ensure content fits on mobile */
    max-width: 100%;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 40px;
    color: var(--white);
    animation: scaleIn 0.5s ease-out;
}

.email-success h3 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    color: var(--navy);
    margin-bottom: 15px;
}

.email-success p {
    color: var(--navy-light);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.email-success p strong {
    color: var(--teal);
    font-weight: 600;
}

.success-note {
    font-size: 14px;
    color: #6b7280;
    font-style: italic;
    margin-bottom: 25px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .email-modal-content {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        margin-top: auto;
    }
    
    .email-modal-body {
        padding: 40px 25px 30px;
    }
    
    .email-modal-title {
        font-size: 26px;
    }
    
    .email-icon {
        width: 70px;
        height: 70px;
        font-size: 32px;
    }
    
    /* Reduce spacing on mobile for better fit */
    .email-success {
        padding: 15px 0;
    }
    
    .success-icon {
        margin-bottom: 20px;
    }
    
    .email-success h3 {
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .email-success p {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .success-note {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .email-modal-content {
        max-height: 80vh;
    }
    
    .email-modal-body {
        padding: 30px 20px 25px;
    }
    
    .email-modal-title {
        font-size: 22px;
    }
    
    .email-modal-subtitle {
        font-size: 14px;
    }
    
    .form-input {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .email-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
        margin-bottom: 20px;
    }
    
    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
        margin-bottom: 15px;
    }
    
    .email-success h3 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .email-success p {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .success-note {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    /* Ensure download button is visible */
    #directDownloadLink {
        margin-top: 15px;
        padding: 12px 24px;
        font-size: 15px;
    }
}

/* Print - Hide Modal */
@media print {
    .email-modal {
        display: none !important;
    }
}
