/* Modern Newsletter Signup Component Styles
 * Premium design with refined glassmorphism
 * @version 2.1.0
 */

.newsletter-signup-section {
    background: linear-gradient(135deg, #0c2340 0%, #1a3a5c 50%, #0c2340 100%);
    position: relative;
    overflow: hidden;
    padding: 80px 0;
}

/* Ultra-black dark mode */
[data-theme="dark"] .newsletter-signup-section {
    background: #000000 !important;
}

/* Subtle animated background pattern */
.newsletter-signup-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(212, 175, 55, 0.06) 0%, transparent 40%);
    animation: newsletterBgPulse 8s ease-in-out infinite;
}

@keyframes newsletterBgPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.newsletter-signup-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-radius: 28px;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Header Styles */
.newsletter-header {
    color: white;
    margin-bottom: 2rem;
}

.newsletter-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.75rem;
    box-shadow:
        0 8px 20px rgba(212, 175, 55, 0.4),
        0 0 0 4px rgba(212, 175, 55, 0.15);
    animation: newsletter-float 4s ease-in-out infinite;
}

@keyframes newsletter-float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-8px) rotate(2deg);
    }
}

.newsletter-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: white;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.newsletter-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0;
    line-height: 1.6;
}

/* Modern Form Container - Safari-compatible solid background */
.newsletter-form-container {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border-radius: 24px;
    padding: 2.5rem;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

/* Form Main Row */
.form-main-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
}

.form-field {
    flex: 1;
}

.email-field {
    flex: 2;
}

.name-field {
    flex: 1.5;
}

.submit-field {
    flex: 0 0 auto;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: #475569 !important; /* Dark gray for visibility on white input background */
    font-size: 1rem;
    z-index: 2;
    pointer-events: none;
}

/* Form inputs - Safari-compatible with high specificity */
.newsletter-form .form-input,
.newsletter-form-container .form-input,
input.form-input,
.form-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem !important;
    background-color: #f8fafc !important; /* Light gray for better contrast */
    background: #f8fafc !important;
    border: 2px solid #94a3b8 !important; /* Darker visible border */
    border-radius: 14px !important;
    font-size: 1rem !important;
    color: #1e293b !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Safari-specific fixes */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
}

.newsletter-form .form-input:focus,
.newsletter-form-container .form-input:focus,
input.form-input:focus,
.form-input:focus {
    outline: none !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    border-color: #d4af37 !important;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.3) !important;
}

.form-input::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #64748b !important;
}

.form-input::-webkit-input-placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}

/* Submit Button - Premium Gold - Safari-compatible */
.newsletter-submit-btn,
button.newsletter-submit-btn,
.newsletter-form .newsletter-submit-btn {
    background-color: #d4af37 !important;
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%) !important;
    color: #0c2340 !important;
    border: 2px solid #d4af37 !important;
    border-radius: 14px !important;
    padding: 1rem 2rem !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 160px;
    visibility: visible !important;
    opacity: 1 !important;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4) !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.newsletter-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f4d03f 0%, #d4af37 100%);
    transform: translateY(-3px);
    box-shadow:
        0 8px 28px rgba(212, 175, 55, 0.5),
        0 0 0 2px rgba(212, 175, 55, 0.3);
}

.newsletter-submit-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

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

.btn-label {
    font-weight: 700;
}

.newsletter-submit-btn .btn-text,
.newsletter-submit-btn .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.newsletter-submit-btn .btn-text {
    display: flex !important;
}

.newsletter-submit-btn .btn-loading {
    display: none;
}

.newsletter-submit-btn.loading .btn-text {
    display: none !important;
}

.newsletter-submit-btn.loading .btn-loading {
    display: flex !important;
}

/* Subscription Options */
.subscription-options {
    margin-bottom: 1.5rem;
}

.subscription-options-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.subscription-option {
    position: relative;
}

.subscription-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Subscription labels - Safari-compatible with high specificity */
.subscription-label,
.subscription-option .subscription-label,
label.subscription-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem !important;
    background-color: #e2e8f0 !important;
    background: #e2e8f0 !important;
    border: 2px solid #94a3b8 !important;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #1e293b !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    white-space: nowrap;
}

.subscription-label:hover,
.subscription-option .subscription-label:hover {
    background-color: #cbd5e1 !important;
    background: #cbd5e1 !important;
    border-color: #64748b !important;
}

.subscription-option input[type="radio"]:checked+.subscription-label {
    background-color: #fef3c7 !important;
    background: #fef3c7 !important;
    border-color: #d4af37 !important;
    color: #1e293b !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3) !important;
}

.subscription-icon {
    font-size: 1rem;
    color: #64748b;
}

.subscription-option input[type="radio"]:checked+.subscription-label .subscription-icon {
    color: #d4af37;
}

.subscription-text {
    font-weight: 500;
}

/* Consent Section */
.consent-section {
    margin-bottom: 1rem;
}

.consent-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
}

/* Checkbox - Safari-compatible with high specificity */
.consent-checkbox input[type="checkbox"],
.newsletter-form input[type="checkbox"],
input[type="checkbox"].form-check-input {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    accent-color: #d4af37 !important;
    cursor: pointer;
    /* Force native appearance for Safari */
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    background-color: #ffffff !important;
    border: 2px solid #475569 !important;
    border-radius: 4px !important;
}

.consent-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #475569;
    font-size: 0.9rem;
    cursor: pointer;
    line-height: 1.4;
}

.consent-label i {
    color: #64748b;
    font-size: 0.9rem;
}

.consent-text {
    font-weight: 400;
}

/* Privacy Section */
/* Success/Error Messages */
#newsletter-messages {
    margin-top: 1.5rem;
    animation: slideDown 0.3s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#newsletter-messages .alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#newsletter-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

#newsletter-success i {
    font-size: 1.25rem;
}

#newsletter-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

#newsletter-error i {
    font-size: 1.25rem;
}

#newsletter-messages .message-text {
    flex: 1;
    font-weight: 500;
}

.newsletter-privacy {
    text-align: center;
    margin-top: 1rem;
}

.privacy-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.privacy-text i {
    font-size: 0.8rem;
}

.privacy-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    transition: opacity 0.3s ease;
}

.privacy-link:hover {
    opacity: 0.8;
}




/* Mobile Responsive */
@media (max-width: 768px) {
    .newsletter-signup-card {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }

    .newsletter-title {
        font-size: 1.5rem;
    }

    .newsletter-subtitle {
        font-size: 0.95rem;
    }

    .newsletter-form-container {
        padding: 1.5rem;
    }

    .form-main-row {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .form-field {
        flex: none;
    }

    .form-input {
        padding: 1.25rem 1rem 1.25rem 3rem;
        font-size: 1.1rem;
    }

    .newsletter-submit-btn {
        padding: 1.25rem 2rem;
        font-size: 1.1rem;
        width: 100%;
    }

    .subscription-options-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .subscription-label {
        padding: 1rem;
        font-size: 1rem;
        justify-content: center;
    }

    .consent-checkbox {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .consent-label {
        font-size: 0.9rem;
        text-align: center;
    }

    .privacy-text {
        font-size: 0.8rem;
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .newsletter-signup-card {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem;
    }

    .newsletter-form-container {
        padding: 1rem;
    }

    .newsletter-title {
        font-size: 1.25rem;
    }

    .newsletter-subtitle {
        font-size: 0.9rem;
    }

    .form-input {
        padding: 1rem 0.75rem 1rem 2.5rem;
        font-size: 1rem;
    }

    .newsletter-submit-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .subscription-label {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Dark theme compatibility */
[data-theme="dark"] .form-input {
    background-color: #ffffff;
    background: #ffffff;
    color: #1e293b;
    border-color: #e2e8f0;
}

[data-theme="dark"] .form-input:focus {
    background-color: #ffffff;
    background: #ffffff;
    border-color: #d4af37;
}

[data-theme="dark"] .newsletter-form-container {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .subscription-label {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #334155;
}

[data-theme="dark"] .subscription-option input[type="radio"]:checked+.subscription-label {
    background: #fef3c7;
    border-color: #d4af37;
}

[data-theme="dark"] .consent-label {
    color: #475569;
}

[data-theme="dark"] .newsletter-submit-btn {
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    color: #0c2340;
}

[data-theme="dark"] .newsletter-submit-btn:hover {
    background: linear-gradient(135deg, #f4d03f 0%, #d4af37 100%);
}

/* ============================================
   SAFARI/iOS SPECIFIC OVERRIDES
   These use maximum specificity to override any framework styles
   ============================================ */

/* Safari form input overrides */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific */
    .newsletter-form-container {
        background: #ffffff !important;
    }
    
    .form-input,
    .newsletter-form .form-input,
    .newsletter-form-container .form-input,
    input[type="email"].form-input,
    input[type="text"].form-input {
        background: #f1f5f9 !important;
        border: 2px solid #64748b !important;
        color: #0f172a !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    .input-icon {
        color: #334155 !important;
    }
    
    .newsletter-submit-btn,
    button.newsletter-submit-btn {
        background: #d4af37 !important;
        border: 2px solid #b8960c !important;
        color: #0c2340 !important;
    }
    
    .subscription-label {
        background: #e2e8f0 !important;
        border: 2px solid #64748b !important;
        color: #0f172a !important;
    }
    
    .subscription-option input[type="radio"]:checked + .subscription-label {
        background: #fef3c7 !important;
        border-color: #d4af37 !important;
    }
}

/* Universal Safari fix using webkit prefix detection */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) {
        .newsletter-form-container {
            background: #ffffff !important;
            border: 1px solid #9ca3af !important;
        }
        
        .form-input {
            background: #f1f5f9 !important;
            border: 2px solid #64748b !important;
        }
        
        .subscription-label {
            background: #e2e8f0 !important;
            border: 2px solid #64748b !important;
        }
        
        .newsletter-submit-btn {
            background: #d4af37 !important;
        }
    }
}