/* Mobile-First Email & Social Popup Styles */
.esp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    animation: espFadeIn 0.3s ease-out;
    box-sizing: border-box;
}

.esp-popup-overlay.esp-hidden {
    display: none;
}

.esp-popup-container {
    background: white;
    border-radius: 16px;
    max-width: 320px;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: espSlideUp 0.4s ease-out;
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
}

.esp-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 15px 15px;
    text-align: center;
    position: relative;
}

.esp-popup-header h2 {
    font-size: 20px;
    margin: 0 0 8px 0;
    font-weight: 600;
    line-height: 1.3;
}

.esp-subtitle {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
    line-height: 1.4;
}

.esp-close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
}

.esp-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.esp-popup-content {
    padding: 20px 15px 15px;
}

.esp-form-group {
    margin-bottom: 15px;
}

.esp-form-group input {
    width: 100%;
    padding: 14px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
    box-sizing: border-box;
    font-family: inherit;
}

.esp-form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.esp-form-group input::placeholder {
    color: #999;
}

.esp-social-compact {
    margin-bottom: 15px;
}

.esp-social-compact select,
.esp-social-compact input {
    width: 100%;
    padding: 14px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
    box-sizing: border-box;
    margin-bottom: 10px;
    font-family: inherit;
}

.esp-social-compact select:focus,
.esp-social-compact input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.esp-social-compact input::placeholder {
    color: #999;
}

.esp-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    min-height: 48px;
    font-family: inherit;
}

.esp-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.esp-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.esp-submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.esp-submit-btn.esp-loading .btn-text {
    opacity: 0;
}

.esp-submit-btn.esp-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: espSpin 1s linear infinite;
}

/* Success Message */
.esp-success-message,
.esp-error-message {
    text-align: center;
    padding: 30px 15px 20px;
}

.esp-success-message.esp-hidden,
.esp-error-message.esp-hidden {
    display: none;
}

.esp-success-icon,
.esp-error-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 32px;
    font-weight: bold;
}

.esp-success-icon {
    background: #28a745;
}

.esp-error-icon {
    background: #dc3545;
}

.esp-success-message h3,
.esp-error-message h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 20px;
}

.esp-success-message p,
.esp-error-message p {
    color: #666;
    font-size: 14px;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.esp-retry-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.esp-retry-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.esp-privacy-notice {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 11px;
    color: #666;
    text-align: center;
    line-height: 1.3;
    border: 1px solid #e9ecef;
}

/* Tablet and Desktop */
@media (min-width: 480px) {
    .esp-popup-container {
        max-width: 380px;
    }
    
    .esp-popup-header {
        padding: 25px 20px 20px;
    }
    
    .esp-popup-header h2 {
        font-size: 22px;
    }
    
    .esp-subtitle {
        font-size: 15px;
    }
    
    .esp-popup-content {
        padding: 25px 20px 20px;
    }
    
    .esp-form-group input,
    .esp-social-compact select,
    .esp-social-compact input {
        padding: 16px 14px;
        font-size: 15px;
    }
    
    .esp-submit-btn {
        padding: 16px;
        font-size: 17px;
        min-height: 52px;
    }
    
    .esp-privacy-notice {
        font-size: 12px;
        padding: 10px 12px;
    }
}

/* Large screens */
@media (min-width: 768px) {
    .esp-popup-container {
        max-width: 420px;
    }
    
    .esp-popup-header h2 {
        font-size: 24px;
    }
    
    .esp-subtitle {
        font-size: 16px;
    }
}

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

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