/* Pharma News Feed — Newsletter sign-up
   Brand navy: #003087 (matches the section nav and box headings) */

:root {
    --pnf-navy: #003087;
    --pnf-navy-dark: #00246a;
    --pnf-ink: #16233d;
    --pnf-muted: #6b7482;
    --pnf-line: #e2e8f0;
}

/* ── Shared form pieces ──────────────────────────────────────────────────── */

.pnf-subscribe {
    font-family: inherit;
}

.pnf-subscribe__heading {
    font-size: 1.4rem;
    line-height: 1.3;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--pnf-ink);
}

.pnf-subscribe__sub {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--pnf-muted);
    margin: 0 0 20px;
}

.pnf-subscribe__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.pnf-field {
    display: flex;
    flex-direction: column;
    flex: 1 1 200px;
    min-width: 0;
    margin: 0;
}

.pnf-field__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--pnf-muted);
    margin-bottom: 5px;
}

.pnf-field__label em {
    font-weight: 400;
    font-style: normal;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.75;
}

.pnf-subscribe input[type="email"],
.pnf-subscribe input[type="text"] {
    width: 100%;
    padding: 11px 14px;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--pnf-ink);
    background: #fff;
    border: 1px solid var(--pnf-line);
    border-radius: 4px;
    box-shadow: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pnf-subscribe input[type="email"]:focus,
.pnf-subscribe input[type="text"]:focus {
    outline: none;
    border-color: var(--pnf-navy);
    box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.12);
}

.pnf-subscribe input.pnf-input-error {
    border-color: #c0392b;
}

.pnf-subscribe__btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 24px;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: #fff;
    background: var(--pnf-navy);
    border: 1px solid var(--pnf-navy);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.05s;
    white-space: nowrap;
}

.pnf-subscribe__btn:hover  { background: var(--pnf-navy-dark); }
.pnf-subscribe__btn:active { transform: translateY(1px); }

.pnf-subscribe__btn[disabled] {
    opacity: 0.65;
    cursor: default;
}

.pnf-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pnf-spin 0.7s linear infinite;
}

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

.pnf-subscribe__note {
    font-size: 0.75rem;
    color: var(--pnf-muted);
    margin: 12px 0 0;
}

.pnf-subscribe__msg {
    margin-top: 14px;
    padding: 11px 14px;
    font-size: 0.88rem;
    line-height: 1.5;
    border-radius: 4px;
}

.pnf-subscribe__msg--ok {
    background: #e8f5ec;
    border: 1px solid #bfe3ca;
    color: #1c6b39;
}

.pnf-subscribe__msg--error {
    background: #fdecea;
    border: 1px solid #f5c6c2;
    color: #a3281c;
}

/* Honeypot — off-screen rather than display:none so bots still see it */
.pnf-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ── Card variant ────────────────────────────────────────────────────────── */

.pnf-subscribe--card {
    position: relative;
    background: linear-gradient(135deg, #f7f9fc 0%, #eef3fa 100%);
    border: 1px solid #dbe4f0;
    border-radius: 6px;
    padding: 30px 32px;
    /* Auto side-margins keep the card aligned even when it is output
       outside the theme's .container wrapper */
    margin: 32px auto;
    max-width: 1140px;
    box-sizing: border-box;
}

.pnf-subscribe--card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--pnf-navy);
    border-radius: 6px 0 0 6px;
}

/* ── Inline variant ──────────────────────────────────────────────────────── */

.pnf-subscribe--inline .pnf-field__label {
    position: absolute;
    left: -9999px;
}

.pnf-subscribe--inline .pnf-subscribe__note {
    margin-top: 8px;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */

.pnf-modal[hidden] { display: none; }

.pnf-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pnf-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 21, 41, 0.6);
    animation: pnf-fade 0.15s ease;
}

.pnf-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    padding: 34px 32px 30px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    animation: pnf-rise 0.18s ease;
}

.pnf-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 1;
    color: #9aa3b0;
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.pnf-modal__close:hover { color: var(--pnf-ink); background: #f1f4f8; }

/* Stacked layout: the 200px flex-basis above is a WIDTH hint for the row
   layout — in a column it would become a height, so reset it. */
.pnf-modal .pnf-subscribe__fields,
.pnf-subscribe--modal .pnf-subscribe__fields { flex-direction: column; align-items: stretch; gap: 14px; }

.pnf-modal .pnf-field,
.pnf-subscribe--modal .pnf-field             { flex: 0 0 auto; }

.pnf-modal .pnf-subscribe__btn,
.pnf-subscribe--modal .pnf-subscribe__btn    { width: 100%; margin-top: 4px; }

@keyframes pnf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pnf-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

/* ── Subscribe button in the theme's header / mobile menu ────────────────── */

.pnf-nav-subscribe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    background: var(--pnf-navy);
    border: 1px solid var(--pnf-navy);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s;
}

.pnf-nav-subscribe:hover,
.pnf-nav-subscribe:focus {
    background: var(--pnf-navy-dark);
    border-color: var(--pnf-navy-dark);
    color: #fff;
}

.pnf-nav-subscribe--desktop {
    margin-left: 28px;
}

.pnf-nav-subscribe--mobile {
    display: none;   /* revealed inside the mobile drawer only */
    width: 100%;
    margin-top: 10px;
    padding: 12px 20px;
    font-size: 16px;
}

@media (max-width: 768px) {
    .pnf-nav-subscribe--desktop { display: none; }
    .pnf-nav-subscribe--mobile  { display: flex; }
}

/* ── Subscribe button in the plugin's own section nav ────────────────────── */

#pnf-top-nav .pnf-nav-subscribe {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 0.4rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #003087 !important;
    background: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s;
}

#pnf-top-nav .pnf-nav-subscribe:hover {
    background: #dce8f5;
    border-color: #dce8f5;
}

@media (max-width: 991.98px) {
    #pnf-top-nav .pnf-nav-subscribe {
        margin: 0.5rem 0 0.25rem;
        width: 100%;
        justify-content: center;
    }
}

/* ── Toast (confirm / unsubscribe feedback) ──────────────────────────────── */

.pnf-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 10060;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: min(560px, calc(100vw - 32px));
    padding: 14px 16px 14px 20px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #fff;
    background: #16233d;
    border-radius: 6px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
    animation: pnf-rise 0.25s ease;
}

.pnf-toast--ok   { border-left: 4px solid #35b06a; }
.pnf-toast--warn { border-left: 4px solid #e0a63b; }

.pnf-toast__close {
    flex: 0 0 auto;
    font-size: 20px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: 0;
    cursor: pointer;
}

.pnf-toast__close:hover { color: #fff; }

/* ── Small screens ───────────────────────────────────────────────────────── */

@media (max-width: 575.98px) {
    .pnf-subscribe--card       { padding: 24px 20px; }
    .pnf-subscribe__fields     { flex-direction: column; align-items: stretch; gap: 14px; }
    .pnf-field                 { flex: 0 0 auto; }   /* see note in the modal rules */
    .pnf-subscribe__btn        { width: 100%; }
    .pnf-modal__dialog         { padding: 30px 22px 26px; }
}
