/* Newsletter Section Styles */
.newsletter-section {
    padding: 6rem 0; /* More padding for breathing room */
    background-color: var(--bg-secondary);
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    position: relative; 
    overflow: hidden; 
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 5;
}

.newsletter-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.newsletter-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem; /* Slightly larger */
    margin-bottom: 1rem;
    color: var(--text-primary);
    position: relative;
}

.newsletter-section p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.6;
    font-size: 1.1rem;
}

.newsletter-form {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    position: relative; /* For absolute positioning of tooltip */
}

.newsletter-input-group input[type="email"] {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.newsletter-input-group input[type="email"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(34, 139, 34, 0.1); /* Fallback green */
}

.newsletter-input-group input[type="email"].input-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Custom Error Tooltip */
.custom-error-tooltip {
    position: absolute;
    bottom: -40px; /* Position below input */
    left: 20px;
    background-color: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.custom-error-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #ef4444;
}

.custom-error-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

[data-theme="dark"] .newsletter-input-group input[type="email"]:focus {
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1); /* Fallback gold */
}

.newsletter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background-color: var(--accent-color);
    color: white; /* Always white on accent */
    border: none;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.newsletter-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.newsletter-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.newsletter-btn.loading .btn-text,
.newsletter-btn.loading i {
    opacity: 0;
}

.newsletter-btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    top: calc(50% - 10px);
    left: calc(50% - 10px);
}

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

.newsletter-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.newsletter-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease-out;
}

.newsletter-message.success {
    background-color: rgba(34, 139, 34, 0.1);
    color: #228B22;
    border: 1px solid rgba(34, 139, 34, 0.2);
}

[data-theme="dark"] .newsletter-message.success {
    background-color: rgba(255, 215, 0, 0.1);
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.newsletter-message.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

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

@media (max-width: 600px) {
    .newsletter-input-group {
        flex-direction: column;
        margin-bottom: 2rem; /* Add space for error message */
    }
    
    .newsletter-btn {
        width: 100%;
    }

    .custom-error-tooltip {
        bottom: 50px; /* Position above button on mobile */
        left: 0;
        right: 0;
        text-align: center;
    }
    
    .custom-error-tooltip::before {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* 
   ABSTRACT SHAPES STYLES - REMOVED
*/

/* Responsive adjustments */
@media (max-width: 1200px) {
    .newsletter-section {
        padding: 5rem 0;
    }
}

@media (max-width: 900px) {
    .newsletter-input-group {
        flex-direction: column;
    }
    
    .newsletter-btn {
        width: 100%;
    }
}
