/* ============================================================
   CRE Intelligence — Newsletter Subscribe Popup + upper-right CTA
   ============================================================ */

.cre-newsletter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.cre-newsletter-overlay.is-active {
    display: flex;
}

body.cre-modal-open {
    overflow: hidden;
    padding-right: 0 !important;
}

.cre-newsletter-dialog {
    background: #ffffff;
    border-radius: 12px;
    padding: 36px 28px 28px;
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.20);
    animation: cre-newsletter-appear 0.2s ease;
    font-family: var(--fpc-sans, Helvetica, Arial, sans-serif);
    text-align: center;
    box-sizing: border-box;
}

@keyframes cre-newsletter-appear {
    from { opacity: 0; transform: translateY(-16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cre-newsletter-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 5px;
    transition: color 0.15s, background 0.15s;
}

.cre-newsletter-close:hover {
    color: #374151;
    background: #f3f4f6;
}

.cre-newsletter-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: rgba(84, 133, 214, 0.1);
    color: var(--fpc-hover, #5485D6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cre-newsletter-heading {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}

.cre-newsletter-subheading {
    font-size: 13.5px;
    line-height: 1.55;
    color: #6b7280;
    margin: 0 0 22px;
}

.cre-newsletter-field {
    display: flex;
    gap: 8px;
}

.cre-newsletter-input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 13.5px;
    color: #1f2937;
    background: #f9fafb;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.cre-newsletter-input:focus {
    border-color: var(--fpc-hover, #5485D6);
    box-shadow: 0 0 0 3px rgba(84, 133, 214, 0.10);
    outline: none;
    background: #fff;
}

.cre-newsletter-submit {
    flex-shrink: 0;
    padding: 11px 20px;
    background: var(--fpc-black, #000);
    color: #ffffff;
    border: none;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    font-family: inherit;
}

.cre-newsletter-submit:hover:not(:disabled) {
    background: #4C78C1;
    box-shadow: 0 4px 14px rgba(84, 133, 214, 0.28);
}

.cre-newsletter-submit:active:not(:disabled) {
    background: #436AAB;
}

.cre-newsletter-submit:disabled,
.cre-newsletter-submit.is-loading {
    opacity: 0.65;
    cursor: not-allowed;
}

.cre-newsletter-status {
    display: none;
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    line-height: 1.5;
    text-align: left;
}

.cre-newsletter-status.cre-success {
    display: block;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.cre-newsletter-status.cre-error {
    display: block;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.cre-newsletter-disclaimer {
    font-size: 11px;
    color: #9ca3af;
    margin: 14px 0 0;
}

@media (max-width: 500px) {
    .cre-newsletter-field {
        flex-direction: column;
    }
    .cre-newsletter-submit {
        width: 100%;
    }
}

/* ============================================================
   Upper-right "Subscribe" CTA on the CRE Intelligence page
   ============================================================ */

.crebook-blog-page .page-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.cre-newsletter-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: var(--cb-primary, #5485D6);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    font-family: var(--cb-font-sans, Helvetica, Arial, sans-serif);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.cre-newsletter-cta svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.cre-newsletter-cta:hover {
    background: #4C78C1;
    box-shadow: 0 4px 14px rgba(84, 133, 214, 0.28);
}

.cre-newsletter-cta.is-subscribed {
    background: #f0fdf4;
    color: #16a34a;
    cursor: default;
    box-shadow: none;
}

@media (max-width: 575px) {
    .cre-newsletter-cta span {
        display: none;
    }
    .cre-newsletter-cta {
        padding: 9px 12px;
        border-radius: 50%;
    }
}
