/**
 * Newsletter Signup Form Styles
 * Responsive, modern design for homepage and footer
 */

/* ==================== BASE STYLES ==================== */

.newsletter-section {
    padding: 40px 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 800px;
    margin: 0 auto;
}

.newsletter-heading {
    text-align: center;
    margin-bottom: 30px;
}

.newsletter-title {
    font-size: 32px;
    font-weight: 700;
    color: #131314;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.newsletter-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* ==================== FORM STYLES ==================== */

.newsletter-form {
    width: 100%;
}

.newsletter-form-fields {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.newsletter-field {
    flex: 1;
    min-width: 200px;
}

.newsletter-field-email {
    flex: 2;
}

.newsletter-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #131314;
    box-sizing: border-box;
}

.newsletter-input:focus {
    outline: none;
    border-color: #ED1C24;
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.1);
}

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

/* ==================== SUBMIT BUTTON ==================== */

.newsletter-submit {
    padding: 14px 32px;
    background: #ED1C24;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.newsletter-submit:hover {
    background: #c71820;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 28, 36, 0.3);
}

.newsletter-submit:active {
    transform: translateY(0);
}

.newsletter-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.newsletter-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==================== CONSENT CHECKBOX ==================== */

.newsletter-consent {
    margin-bottom: 16px;
}

.newsletter-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.newsletter-consent-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.newsletter-consent-text {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* ==================== MESSAGES ==================== */

.newsletter-message {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    margin-top: 16px;
    text-align: center;
}

.newsletter-message.newsletter-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.newsletter-message.newsletter-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ==================== HOMEPAGE STYLE ==================== */

.homepage-newsletter-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.newsletter-style-default {
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* ==================== FOOTER STYLE ==================== */

.footer-newsletter-wrap {
    padding: 40px 0 50px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 40px;
}

.newsletter-style-footer {
    background: linear-gradient(135deg, #131314 0%, #2d2d2f 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 50px 40px;
}

.newsletter-style-footer .newsletter-title {
    color: #ffffff;
}

.newsletter-style-footer .newsletter-subtitle {
    color: #d1d5db;
}

.newsletter-style-footer .newsletter-input {
    background: #ffffff;
    border-color: #4b5563;
}

.newsletter-style-footer .newsletter-input:focus {
    border-color: #ED1C24;
}

.newsletter-style-footer .newsletter-consent-text {
    color: #d1d5db;
}

/* ==================== COMPACT STYLE ==================== */

.newsletter-style-compact {
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.newsletter-style-compact .newsletter-title {
    font-size: 24px;
}

.newsletter-style-compact .newsletter-subtitle {
    font-size: 14px;
}

.newsletter-style-compact .newsletter-form-fields {
    margin-bottom: 12px;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 767px) {
    .newsletter-section {
        padding: 30px 20px;
        border-radius: 8px;
    }
    
    .newsletter-title {
        font-size: 24px;
    }
    
    .newsletter-subtitle {
        font-size: 14px;
    }
    
    .newsletter-form-fields {
        flex-direction: column;
        gap: 12px;
    }
    
    .newsletter-field,
    .newsletter-field-email {
        flex: none;
        width: 100%;
        min-width: 100%;
    }
    
    .newsletter-submit {
        width: 100%;
        justify-content: center;
    }
    
    .newsletter-input {
        padding: 12px 16px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    .homepage-newsletter-section {
        padding: 40px 0;
    }
    
    .footer-newsletter-wrap {
        padding: 30px 0 40px 0;
    }
    
    .newsletter-style-footer {
        padding: 30px 20px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .newsletter-title {
        font-size: 28px;
    }
    
    .newsletter-form-fields {
        flex-wrap: nowrap;
    }
}

@media (min-width: 1024px) {
    .newsletter-form-fields {
        flex-wrap: nowrap;
    }
}

/* ==================== ACCESSIBILITY ==================== */

.newsletter-input:focus-visible {
    outline: 3px solid rgba(237, 28, 36, 0.5);
    outline-offset: 2px;
}

.newsletter-submit:focus-visible {
    outline: 3px solid rgba(237, 28, 36, 0.5);
    outline-offset: 2px;
}

.newsletter-consent-checkbox:focus-visible {
    outline: 2px solid #ED1C24;
    outline-offset: 2px;
}

/* ==================== ANIMATIONS ==================== */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.newsletter-message {
    animation: slideDown 0.3s ease-out;
}

/* ==================== LOADING STATE ==================== */

.newsletter-submit:disabled {
    position: relative;
}

.newsletter-submit-loading {
    display: inline-flex;
    align-items: center;
}

/* ==================== POPUP STYLES ==================== */

.newsletter-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.newsletter-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.newsletter-popup-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: popupSlideIn 0.3s ease-out;
    z-index: 1;
}

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

.newsletter-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.newsletter-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.newsletter-popup-close svg {
    color: #6b7280;
}

.newsletter-popup-inner {
    padding: 50px 40px 40px 40px;
    text-align: center;
}

.newsletter-popup-icon {
    margin: 0 auto 20px auto;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ED1C24 0%, #c71820 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(237, 28, 36, 0.3);
}

.newsletter-popup-icon svg {
    color: #ffffff;
}

.newsletter-popup-title {
    font-size: 32px;
    font-weight: 700;
    color: #131314;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.newsletter-popup-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 30px 0;
    line-height: 1.5;
}

.newsletter-popup-form {
    margin-bottom: 20px;
}

.newsletter-popup-field {
    margin-bottom: 16px;
}

.newsletter-popup-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: #f9fafb;
    color: #131314;
    box-sizing: border-box;
}

.newsletter-popup-input:focus {
    outline: none;
    border-color: #ED1C24;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(237, 28, 36, 0.1);
}

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

.newsletter-popup-submit {
    width: 100%;
    padding: 16px 32px;
    background: #ED1C24;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.newsletter-popup-submit:hover {
    background: #c71820;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 28, 36, 0.4);
}

.newsletter-popup-submit:active {
    transform: translateY(0);
}

.newsletter-popup-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.newsletter-popup-consent {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    text-align: left;
    justify-content: center;
}

.newsletter-popup-consent-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.newsletter-popup-consent-text {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.newsletter-popup-message {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    margin-top: 16px;
    text-align: center;
}

.newsletter-popup-message.newsletter-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.newsletter-popup-message.newsletter-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.newsletter-popup-footer {
    font-size: 13px;
    color: #9ca3af;
    margin: 20px 0 0 0;
}

/* ==================== POPUP RESPONSIVE ==================== */

@media (max-width: 767px) {
    .newsletter-popup {
        padding: 10px;
    }
    
    .newsletter-popup-content {
        border-radius: 12px;
        max-height: 95vh;
    }
    
    .newsletter-popup-inner {
        padding: 40px 24px 30px 24px;
    }
    
    .newsletter-popup-icon {
        width: 70px;
        height: 70px;
    }
    
    .newsletter-popup-icon svg {
        width: 56px;
        height: 56px;
    }
    
    .newsletter-popup-title {
        font-size: 26px;
    }
    
    .newsletter-popup-subtitle {
        font-size: 15px;
    }
    
    .newsletter-popup-input {
        padding: 14px 18px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    .newsletter-popup-submit {
        padding: 14px 28px;
        font-size: 17px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .newsletter-popup-content {
        max-width: 450px;
    }
}

/* ==================== PRINT STYLES ==================== */

@media print {
    .newsletter-section,
    .homepage-newsletter-section,
    .footer-newsletter-wrap,
    .newsletter-popup {
        display: none !important;
    }
}
