/* ============================================================
   AutoScribe Newsletter Popup — Fixed Layout, Brand Colors Only
   ============================================================ */

:root {
    --anl-primary:       #6366f1;
    --anl-primary-dark:  #4f46e5;
    --anl-primary-light: #f0f0ff;
    --anl-primary-rgb:   99, 102, 241;
}

/* ── Overlay ── */
.autoscribe-nl-popup-overlay {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    background: rgba(0, 0, 0, 0.55) !important;
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    animation: anl-fade 0.2s ease !important;
    margin: 0 !important;
}

@keyframes anl-fade { from { opacity: 0; } to { opacity: 1; } }

/* ── Card ── */
.autoscribe-nl-popup-card {
    background: var(--anl-primary-light) !important;
    max-width: 420px !important;
    width: 100% !important;
    border-radius: 16px !important;
    padding: 0 !important;
    position: relative !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22) !important;
    overflow: hidden !important;
    animation: anl-slide 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    margin: 0 !important;
    border: 1px solid rgba(var(--anl-primary-rgb), 0.15) !important;
}

@keyframes anl-slide {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Brand color top bar */
.autoscribe-nl-popup-card::before {
    content: '' !important;
    display: block !important;
    height: 4px !important;
    background: linear-gradient(90deg, var(--anl-primary), var(--anl-primary-dark)) !important;
}

/* ── Inner padding ── */
.autoscribe-nl-popup-inner {
    padding: 26px 26px 20px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.autoscribe-nl-popup-inner * {
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* ── Close button ── */
.autoscribe-nl-popup-close {
    position: absolute !important;
    top: 12px !important; right: 12px !important;
    background: #f3f4f6 !important;
    border: none !important;
    border-radius: 50% !important;
    width: 28px !important; height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    cursor: pointer !important;
    color: #6b7280 !important;
    transition: background 0.18s, color 0.18s !important;
    z-index: 2 !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.autoscribe-nl-popup-close:hover {
    background: #e5e7eb !important;
    color: #111827 !important;
}

/* ── Icon — brand color ── */
.autoscribe-nl-popup-icon {
    width: 46px !important; height: 46px !important;
    background: linear-gradient(135deg, var(--anl-primary), var(--anl-primary-dark)) !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 22px !important;
    margin: 0 0 14px 0 !important;
    box-shadow: 0 4px 12px rgba(var(--anl-primary-rgb), 0.28) !important;
    border: none !important;
}

/* ── Title ── */
.autoscribe-nl-popup-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    letter-spacing: -0.01em !important;
    text-transform: none !important;
    border: none !important;
    background: none !important;
}

/* ── Description ── */
.autoscribe-nl-popup-description {
    color: #6b7280 !important;
    font-size: 0.875rem !important;
    margin: 0 0 18px 0 !important;
    padding: 0 !important;
    line-height: 1.6 !important;
    font-weight: 400 !important;
    text-transform: none !important;
}

/* ── Input ── */
.autoscribe-nl-input {
    display: block !important;
    width: 100% !important;
    border: 1.5px solid rgba(var(--anl-primary-rgb), 0.2) !important;
    border-radius: 9px !important;
    padding: 11px 14px !important;
    margin: 0 0 10px 0 !important;
    font-size: 0.9rem !important;
    color: #111827 !important;
    background: #ffffff !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s !important;
    box-shadow: none !important;
}

.autoscribe-nl-input::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

.autoscribe-nl-input:focus {
    border-color: var(--anl-primary) !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(var(--anl-primary-rgb), 0.12) !important;
    outline: none !important;
}

/* ── GDPR ── */
.autoscribe-nl-gdpr {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    font-size: 0.77rem !important;
    color: #9ca3af !important;
    line-height: 1.5 !important;
    cursor: pointer !important;
    font-weight: 400 !important;
    text-transform: none !important;
}

.autoscribe-nl-gdpr input[type="checkbox"] {
    margin: 2px 0 0 0 !important;
    flex-shrink: 0 !important;
    width: 14px !important; height: 14px !important;
    accent-color: var(--anl-primary) !important;
    cursor: pointer !important;
    padding: 0 !important;
}

.autoscribe-nl-gdpr span {
    color: #9ca3af !important;
    font-size: 0.77rem !important;
}

/* ── Submit — brand color ── */
.autoscribe-nl-submit {
    display: block !important;
    width: 100% !important;
    background: var(--anl-primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 9px !important;
    padding: 12px !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background 0.18s, transform 0.12s, box-shadow 0.18s !important;
    box-shadow: 0 3px 10px rgba(var(--anl-primary-rgb), 0.32) !important;
    letter-spacing: 0.01em !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    text-align: center !important;
    text-decoration: none !important;
}

.autoscribe-nl-submit:hover {
    background: var(--anl-primary-dark) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 5px 16px rgba(var(--anl-primary-rgb), 0.42) !important;
    color: #ffffff !important;
}

.autoscribe-nl-submit:active { transform: translateY(0) !important; }

.autoscribe-nl-submit:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ── Error ── */
.autoscribe-nl-error {
    color: #ef4444 !important;
    font-size: 12px !important;
    margin: 8px 0 0 0 !important;
    display: block !important;
    padding: 7px 11px !important;
    background: #fef2f2 !important;
    border-radius: 7px !important;
    border-left: 3px solid #ef4444 !important;
    font-weight: 400 !important;
}

/* ── Success ── */
.autoscribe-nl-success {
    text-align: center !important;
    padding: 18px 0 6px !important;
    margin: 0 !important;
}

.autoscribe-nl-success-icon {
    font-size: 40px !important;
    display: block !important;
    margin: 0 0 10px 0 !important;
    animation: anl-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes anl-pop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.autoscribe-nl-success-text {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 0 3px 0 !important;
    padding: 0 !important;
}

.autoscribe-nl-success-sub {
    font-size: 0.83rem !important;
    color: #6b7280 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 400 !important;
}

/* ── Privacy note ── */
.autoscribe-nl-privacy {
    text-align: center !important;
    font-size: 11px !important;
    color: #d1d5db !important;
    margin: 12px 0 0 0 !important;
    padding: 0 !important;
    font-weight: 400 !important;
}

/* ── Mobile ── */
@media (max-width: 460px) {
    .autoscribe-nl-popup-inner { padding: 20px 18px 16px !important; }
    .autoscribe-nl-popup-title { font-size: 1.05rem !important; }
    .autoscribe-nl-popup-card { border-radius: 14px !important; }
}

/* ============================================================
   DARK MODE — Popup
   ============================================================ */

@media (prefers-color-scheme: dark) {
    .autoscribe-nl-popup-card {
        background: #1e1e2e !important;
        border-color: rgba(255,255,255,0.08) !important;
        box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
    }
    .autoscribe-nl-popup-title       { color: #f1f5f9 !important; }
    .autoscribe-nl-popup-description { color: #94a3b8 !important; }
    .autoscribe-nl-input {
        background: #2a2a3e !important;
        border-color: rgba(255,255,255,0.12) !important;
        color: #f1f5f9 !important;
    }
    .autoscribe-nl-input::placeholder { color: rgba(255,255,255,0.3) !important; }
    .autoscribe-nl-input:focus { background: #32324a !important; }
    .autoscribe-nl-gdpr,
    .autoscribe-nl-gdpr span  { color: #64748b !important; }
    .autoscribe-nl-privacy    { color: rgba(255,255,255,0.2) !important; }
    .autoscribe-nl-success-text { color: #f1f5f9 !important; }
    .autoscribe-nl-success-sub  { color: #94a3b8 !important; }
    .autoscribe-nl-popup-close {
        background: rgba(255,255,255,0.08) !important;
        color: #94a3b8 !important;
    }
    .autoscribe-nl-popup-close:hover {
        background: rgba(255,255,255,0.15) !important;
        color: #f1f5f9 !important;
    }
}

/* ── Theme class-based dark mode ── */
.dark                    .autoscribe-nl-popup-card,
.dark-mode               .autoscribe-nl-popup-card,
.night-mode              .autoscribe-nl-popup-card,
[data-theme="dark"]      .autoscribe-nl-popup-card,
[data-bs-theme="dark"]   .autoscribe-nl-popup-card,
[data-color-mode="dark"] .autoscribe-nl-popup-card,
.wp-dark-mode-active     .autoscribe-nl-popup-card {
    background: #1e1e2e !important;
    border-color: rgba(255,255,255,0.08) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
}

.dark                    .autoscribe-nl-popup-title,
.dark-mode               .autoscribe-nl-popup-title,
.night-mode              .autoscribe-nl-popup-title,
[data-theme="dark"]      .autoscribe-nl-popup-title,
[data-bs-theme="dark"]   .autoscribe-nl-popup-title,
[data-color-mode="dark"] .autoscribe-nl-popup-title,
.wp-dark-mode-active     .autoscribe-nl-popup-title { color: #f1f5f9 !important; }

.dark                    .autoscribe-nl-popup-description,
.dark-mode               .autoscribe-nl-popup-description,
.night-mode              .autoscribe-nl-popup-description,
[data-theme="dark"]      .autoscribe-nl-popup-description,
[data-bs-theme="dark"]   .autoscribe-nl-popup-description,
[data-color-mode="dark"] .autoscribe-nl-popup-description,
.wp-dark-mode-active     .autoscribe-nl-popup-description { color: #94a3b8 !important; }

.dark                    .autoscribe-nl-input,
.dark-mode               .autoscribe-nl-input,
.night-mode              .autoscribe-nl-input,
[data-theme="dark"]      .autoscribe-nl-input,
[data-bs-theme="dark"]   .autoscribe-nl-input,
[data-color-mode="dark"] .autoscribe-nl-input,
.wp-dark-mode-active     .autoscribe-nl-input {
    background: #2a2a3e !important;
    border-color: rgba(255,255,255,0.12) !important;
    color: #f1f5f9 !important;
}

.dark                    .autoscribe-nl-input::placeholder,
.dark-mode               .autoscribe-nl-input::placeholder,
.night-mode              .autoscribe-nl-input::placeholder,
[data-theme="dark"]      .autoscribe-nl-input::placeholder,
[data-bs-theme="dark"]   .autoscribe-nl-input::placeholder,
[data-color-mode="dark"] .autoscribe-nl-input::placeholder,
.wp-dark-mode-active     .autoscribe-nl-input::placeholder { color: rgba(255,255,255,0.3) !important; }

.dark                    .autoscribe-nl-gdpr,
.dark                    .autoscribe-nl-gdpr span,
.dark-mode               .autoscribe-nl-gdpr,
.dark-mode               .autoscribe-nl-gdpr span,
.night-mode              .autoscribe-nl-gdpr,
[data-theme="dark"]      .autoscribe-nl-gdpr,
[data-theme="dark"]      .autoscribe-nl-gdpr span,
[data-bs-theme="dark"]   .autoscribe-nl-gdpr,
[data-color-mode="dark"] .autoscribe-nl-gdpr,
.wp-dark-mode-active     .autoscribe-nl-gdpr { color: #64748b !important; }

.dark                    .autoscribe-nl-privacy,
.dark-mode               .autoscribe-nl-privacy,
.night-mode              .autoscribe-nl-privacy,
[data-theme="dark"]      .autoscribe-nl-privacy,
[data-bs-theme="dark"]   .autoscribe-nl-privacy,
[data-color-mode="dark"] .autoscribe-nl-privacy,
.wp-dark-mode-active     .autoscribe-nl-privacy { color: rgba(255,255,255,0.2) !important; }

.dark                    .autoscribe-nl-popup-close,
.dark-mode               .autoscribe-nl-popup-close,
[data-theme="dark"]      .autoscribe-nl-popup-close,
[data-bs-theme="dark"]   .autoscribe-nl-popup-close,
.wp-dark-mode-active     .autoscribe-nl-popup-close {
    background: rgba(255,255,255,0.08) !important;
    color: #94a3b8 !important;
}

.dark                    .autoscribe-nl-success-text,
.dark-mode               .autoscribe-nl-success-text,
[data-theme="dark"]      .autoscribe-nl-success-text,
[data-bs-theme="dark"]   .autoscribe-nl-success-text,
.wp-dark-mode-active     .autoscribe-nl-success-text { color: #f1f5f9 !important; }

.dark                    .autoscribe-nl-success-sub,
.dark-mode               .autoscribe-nl-success-sub,
[data-theme="dark"]      .autoscribe-nl-success-sub,
[data-bs-theme="dark"]   .autoscribe-nl-success-sub,
.wp-dark-mode-active     .autoscribe-nl-success-sub { color: #94a3b8 !important; }
