/* ================================================================
   ZFB Newsletter – Modal Styles
   Injected globally; only the modal overlay + box are styled here.
   ================================================================ */

/* ── Variables (matches ZFB design system) ──────────────────────── */
:root {
    --zfb-nl-primary: #f25244;
    --zfb-nl-primary-dark: #d13e30;
    --zfb-nl-bg: #f3f4f6;
    --zfb-nl-text: #0a0a0a;
    --zfb-nl-text-muted: #6b7280;
    --zfb-nl-border: #e5e7eb;
    --zfb-nl-success: #16a34a;
    --zfb-nl-error: #dc2626;
}

/* ── Utility ────────────────────────────────────────────────────── */
.zfb-nl-hidden {
    display: none !important;
}

/* ── Modal overlay ──────────────────────────────────────────────── */
.zfb-nl-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: zfb-nl-fadeIn 0.25s ease;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--zfb-nl-text);
}

@keyframes zfb-nl-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal box ──────────────────────────────────────────────────── */
.zfb-nl-modal {
    position: relative;
    width: 90%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 32px 32px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: zfb-nl-slideUp 0.3s ease;
    box-sizing: border-box;
}

.zfb-nl-modal *,
.zfb-nl-modal *::before,
.zfb-nl-modal *::after {
    box-sizing: border-box;
}

@keyframes zfb-nl-slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Close button */
.zfb-nl-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--zfb-nl-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.zfb-nl-modal-close:hover {
    color: var(--zfb-nl-text);
}

/* Icon */
.zfb-nl-modal-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

/* Title & desc */
.zfb-nl-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--zfb-nl-text);
    margin: 0 0 8px;
}

.zfb-nl-modal-desc {
    font-size: 0.9rem;
    color: var(--zfb-nl-text-muted);
    margin: 0 0 24px;
}

/* ── Input ──────────────────────────────────────────────────────── */
.zfb-nl-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    border: 1px solid var(--zfb-nl-border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--zfb-nl-text);
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.zfb-nl-input:focus {
    border-color: var(--zfb-nl-primary);
    box-shadow: 0 0 0 3px rgba(242, 82, 68, 0.12);
}

.zfb-nl-input::placeholder {
    color: #9ca3af;
}

/* Fields grid */
.zfb-nl-modal-fields {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.zfb-nl-field {
    flex: 1;
    text-align: left;
}

.zfb-nl-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--zfb-nl-text);
    margin-bottom: 6px;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.zfb-nl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--zfb-nl-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.zfb-nl-btn:hover {
    background-color: var(--zfb-nl-primary-dark);
}

.zfb-nl-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.zfb-nl-btn-secondary {
    background-color: transparent;
    color: var(--zfb-nl-text-muted);
    border: 1px solid var(--zfb-nl-border);
}

.zfb-nl-btn-secondary:hover {
    background-color: var(--zfb-nl-bg);
    color: var(--zfb-nl-text);
}

/* Actions row */
.zfb-nl-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.zfb-nl-modal-actions .zfb-nl-btn {
    flex: 1;
}

/* ── Message ────────────────────────────────────────────────────── */
.zfb-nl-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 16px;
}

.zfb-nl-message.success {
    background: #f0fdf4;
    color: var(--zfb-nl-success);
    border: 1px solid #bbf7d0;
}

.zfb-nl-message.error {
    background: #fef2f2;
    color: var(--zfb-nl-error);
    border: 1px solid #fecaca;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .zfb-nl-modal-fields {
        flex-direction: column;
    }

    .zfb-nl-modal {
        padding: 32px 20px 24px;
    }

    .zfb-nl-modal-actions {
        flex-direction: column-reverse;
    }
}

/* ── Hide Bricks success message on the newsletter form ─────────── */
#newsletter-form-widget .message.success {
    display: none !important;
}