/**
 * Filmy Network — Newsletter Component Stylesheet (Phase 32B-3)
 *
 * Scoped styling for the newsletter subscription component.
 * Provides accessible focus states, responsive typography,
 * animated loading spinner, error feedback, and success replacement card.
 *
 * @package Filmy_Network
 * @since   2.3.0
 */

/* ── Container & Form Structure ────────────────────────────────────────── */
.fn-newsletter-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .fn-newsletter-wrapper {
        margin: 0;
    }
}

.fn-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* ── 1. Email Field ────────────────────────────────────────────────────── */
.fn-newsletter-field {
    width: 100%;
}

.fn-newsletter-input {
    width: 100%;
    box-sizing: border-box;
    background-color: var(--fn-bg-input, #1a1e29);
    border: 1px solid var(--fn-border, #232838);
    border-radius: var(--fn-radius-md, 6px);
    padding: 10px 14px;
    color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fn-newsletter-input::placeholder {
    color: var(--fn-text-muted, #64748b);
    opacity: 1;
}

.fn-newsletter-input:focus {
    border-color: var(--fn-red, #e50914);
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.4);
}

.fn-newsletter-input--invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

/* ── 2. Consent Checkbox & Label ───────────────────────────────────────── */
.fn-newsletter-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
}

.fn-newsletter-checkbox {
    margin-top: 2px;
    accent-color: var(--fn-red, #e50914);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
    outline: none;
}

.fn-newsletter-checkbox:focus-visible {
    outline: 2px solid var(--fn-red, #e50914);
    outline-offset: 2px;
}

.fn-newsletter-checkbox--invalid {
    outline: 2px solid #ef4444 !important;
    outline-offset: 2px !important;
}

.fn-newsletter-consent-label {
    font-size: 12px;
    line-height: 1.45;
    color: var(--fn-text-secondary, #94a3b8);
    cursor: pointer;
    user-select: none;
}

.fn-newsletter-privacy-link {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

.fn-newsletter-privacy-link:hover,
.fn-newsletter-privacy-link:focus-visible {
    color: var(--fn-red, #e50914);
}

/* ── 3. Submit Button & Actions ────────────────────────────────────────── */
.fn-newsletter-actions {
    width: 100%;
}

.fn-newsletter-btn {
    width: 100%;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--fn-radius-md, 6px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.fn-newsletter-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.fn-newsletter-btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Loading Spinner */
.fn-newsletter-btn__spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: fn-nl-spin 0.75s linear infinite;
    flex-shrink: 0;
}

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

@media (prefers-reduced-motion: reduce) {
    .fn-newsletter-btn__spinner {
        animation: none;
        border-style: dotted;
    }
}

/* ── 4. Live Feedback / Error Announcements ────────────────────────────── */
.fn-newsletter-feedback {
    font-size: 13px;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: var(--fn-radius-md, 6px);
    text-align: left;
    box-sizing: border-box;
}

.fn-newsletter-feedback--error {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.fn-newsletter-feedback--success {
    background-color: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86efac;
}

/* ── 5. Inline Replacement Success Card ────────────────────────────────── */
.fn-newsletter-success-card {
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: var(--fn-radius-lg, 12px);
    padding: 22px 20px;
    text-align: center;
    box-sizing: border-box;
    outline: none;
}

.fn-newsletter-success-card:focus {
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.6);
}

.fn-newsletter-success-card__icon {
    width: 38px;
    height: 38px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background-color: rgba(34, 197, 94, 0.25);
    color: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.fn-newsletter-success-card__title {
    font-family: var(--fn-font-display, inherit);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px;
}

.fn-newsletter-success-card__desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--fn-text-secondary, #94a3b8);
    margin: 0 0 16px;
}

.fn-newsletter-reset-btn {
    font-size: 12px;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #e2e8f0;
    border-radius: var(--fn-radius-md, 4px);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.fn-newsletter-reset-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
}

.fn-newsletter-reset-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* ── Responsive Mobile Layout ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .fn-newsletter-wrapper {
        max-width: 100%;
    }

    .fn-newsletter-input,
    .fn-newsletter-btn {
        width: 100%;
    }
}

