/* NBM Insider sign-up pop-up. Every class starts "nbms" so nothing clashes with the site CSS. */
.nbms {
    --nbms-navy: #001647;
    --nbms-navy-2: #0a2a6b;
    --nbms-cyan: #28bed9;
    --nbms-cyan-hover: #24abc3;
    --nbms-red: #b3282d;
    --nbms-ink: #1d2433;
    --nbms-muted: #5b6475;
    --nbms-line: #d9dee7;
    --nbms-width: 380px;
    --nbms-gap: 24px;          /* distance from the screen edge */
    --nbms-clear-bottom: 96px; /* keeps the card above the live-chat button in the bottom corner */
    --nbms-speed: 650ms;
    --nbms-spring: cubic-bezier(.2, 1.25, .35, 1);
    --nbms-out: cubic-bezier(.55, 0, .75, .2);

    /* A full-height strip at the right-hand edge; the card sits in the middle of it.
       The strip lets clicks through (pointer-events: none), so only the card itself is "there". */
    position: fixed;
    top: var(--nbms-gap);
    bottom: var(--nbms-clear-bottom);
    right: var(--nbms-gap);
    z-index: 9990;
    display: flex;
    align-items: center;
    width: var(--nbms-width);
    max-width: calc(100vw - 2 * var(--nbms-gap));
    font-family: "Lato", Helvetica, Arial, sans-serif;
    color: var(--nbms-ink);
    line-height: 1.45;
    perspective: 1200px;
    pointer-events: none;
}
.nbms--left { right: auto; left: var(--nbms-gap); }
.nbms[hidden] { display: none; }
.nbms *, .nbms *::before, .nbms *::after { box-sizing: border-box; }

/* ---------- Card + in/out animation ---------- */
.nbms__card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px -12px rgba(0, 22, 71, .45), 0 2px 6px rgba(0, 22, 71, .12);
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    transform-origin: 100% 50%;
    opacity: 0;
    transform: translateX(calc(100% + 40px)) rotateY(-22deg) scale(.94);
    transition: transform var(--nbms-speed) var(--nbms-spring), opacity calc(var(--nbms-speed) * .6) ease;
    pointer-events: auto;
}
.nbms--left .nbms__card { transform-origin: 0% 50%; transform: translateX(calc(-100% - 40px)) rotateY(22deg) scale(.94); }
.nbms.is-open .nbms__card { opacity: 1; transform: none; }
.nbms.is-closing .nbms__card {
    opacity: 0;
    transform: translateX(calc(100% + 40px)) scale(.96);
    transition: transform 420ms var(--nbms-out), opacity 300ms ease 100ms;
}
.nbms--left.is-closing .nbms__card { transform: translateX(calc(-100% - 40px)) scale(.96); }

/* Cyan glow sweeping the top edge */
.nbms__card::before {
    content: "";
    position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 3;
    background: linear-gradient(90deg, transparent, var(--nbms-cyan) 40%, #fff 50%, var(--nbms-cyan) 60%, transparent);
    background-size: 250% 100%;
    animation: nbms-sweep 4s linear infinite;
}
@keyframes nbms-sweep { from { background-position: 125% 0; } to { background-position: -125% 0; } }

/* ---------- Header ---------- */
.nbms__head {
    position: relative;
    padding: 22px 56px 22px 24px;
    background: radial-gradient(120% 140% at 100% 0%, var(--nbms-navy-2) 0%, var(--nbms-navy) 60%);
    color: #fff;
    overflow: hidden;
}
.nbms__net { position: absolute; inset: 0; width: 100%; height: 100%; }
.nbms__lines path { fill: none; stroke: rgba(40, 190, 217, .18); stroke-width: 1.5; }
.nbms__pulses path {
    fill: none; stroke: var(--nbms-cyan); stroke-width: 2; stroke-linecap: round;
    stroke-dasharray: 8 92; stroke-dashoffset: 100;
    filter: drop-shadow(0 0 4px var(--nbms-cyan));
    animation: nbms-pulse 3.6s linear infinite;
}
.nbms__pulses path:nth-child(2) { animation-duration: 4.4s; animation-delay: -1.2s; }
.nbms__pulses path:nth-child(3) { animation-duration: 2.8s; animation-delay: -2s; }
.nbms__pulses path:nth-child(4) { animation-duration: 3.2s; animation-delay: -.6s; }
@keyframes nbms-pulse { to { stroke-dashoffset: 0; } }
.nbms__nodes circle { fill: var(--nbms-navy); stroke: rgba(40, 190, 217, .6); stroke-width: 1.5; animation: nbms-node 2.4s ease-in-out infinite; }
.nbms__nodes circle:nth-child(2n) { animation-delay: -1.2s; }
.nbms__nodes circle:nth-child(3n) { animation-delay: -.6s; }
@keyframes nbms-node { 50% { fill: var(--nbms-cyan); } }

.nbms__eyebrow {
    position: relative;
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase;
    color: var(--nbms-cyan);
    background: rgba(40, 190, 217, .12);
    border: 1px solid rgba(40, 190, 217, .35);
    padding: 4px 10px; border-radius: 50px;
}
.nbms__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--nbms-cyan); box-shadow: 0 0 0 0 rgba(40, 190, 217, .7); animation: nbms-ping 1.8s ease-out infinite; }
@keyframes nbms-ping { 70%, 100% { box-shadow: 0 0 0 8px rgba(40, 190, 217, 0); } }

.nbms .nbms__title {
    position: relative;
    margin: 12px 0 0; padding: 0;
    font-size: 22px; line-height: 1.2; font-weight: 900; color: #fff;
    letter-spacing: -.01em; text-shadow: none; text-align: left;
}

.nbms__close {
    position: absolute; top: 14px; right: 14px; z-index: 4;
    width: 34px; height: 34px; padding: 0;
    display: grid; place-items: center;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer;
    transition: background .2s, transform .35s var(--nbms-spring);
}
.nbms__close:hover { background: rgba(255, 255, 255, .22); transform: rotate(90deg); }
.nbms__close:focus-visible { outline: 2px solid var(--nbms-cyan); outline-offset: 2px; }
.nbms__close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* ---------- Body ---------- */
.nbms__body { position: relative; padding: 20px 24px 22px; }
.nbms .nbms__intro { margin: 0 0 14px; font-size: 15px; color: var(--nbms-muted); }

.nbms__perks { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 9px; }
.nbms__perks li { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 700; color: var(--nbms-navy); margin: 0; padding: 0; }
.nbms__perks li::before { content: none; }
.nbms__perks svg {
    flex: none; width: 32px; height: 32px; padding: 6px;
    border-radius: 9px; background: rgba(40, 190, 217, .12);
    fill: none; stroke: var(--nbms-cyan-hover); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.nbms__perks svg .fill { fill: var(--nbms-cyan-hover); stroke: none; }

/* Staggered entrance for the contents */
.nbms .nbms__eyebrow, .nbms .nbms__title, .nbms__intro, .nbms__perks li, .nbms__reveal, .nbms__form > * {
    opacity: 0; transform: translateY(12px);
    transition: opacity .45s ease, transform .55s var(--nbms-spring);
}
.nbms.is-open .nbms__eyebrow, .nbms.is-open .nbms__title, .nbms.is-open .nbms__intro,
.nbms.is-open .nbms__perks li, .nbms.is-open .nbms__reveal, .nbms.is-open .nbms__form > * { opacity: 1; transform: none; }
.nbms.is-open .nbms__eyebrow { transition-delay: .15s; }
.nbms.is-open .nbms__title { transition-delay: .22s; }
.nbms.is-open .nbms__intro { transition-delay: .3s; }
.nbms.is-open .nbms__perks li:nth-child(1) { transition-delay: .36s; }
.nbms.is-open .nbms__perks li:nth-child(2) { transition-delay: .42s; }
.nbms.is-open .nbms__perks li:nth-child(3) { transition-delay: .48s; }
.nbms.is-open .nbms__reveal { transition-delay: .56s; }
.nbms.is-open .nbms__form > *:nth-child(1) { transition-delay: .54s; }
.nbms.is-open .nbms__form > *:nth-child(2) { transition-delay: .58s; }
.nbms.is-open .nbms__form > *:nth-child(3) { transition-delay: .62s; }
.nbms.is-open .nbms__form > *:nth-child(n+4) { transition-delay: .68s; }

/* ---------- Form ---------- */
.nbms__form { margin: 0; display: grid; gap: 10px; }
.nbms__field { position: relative; }
.nbms__field input {
    display: block; width: 100%; height: 50px; margin: 0;
    padding: 20px 14px 6px;
    font: inherit; font-size: 15px; color: var(--nbms-ink);
    background: #f5f7fa; border: 1.5px solid var(--nbms-line); border-radius: 10px;
    box-shadow: none; outline: none; appearance: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.nbms__field input:hover { border-color: #b9c2d0; }
.nbms__field input:focus { background: #fff; border-color: var(--nbms-cyan); box-shadow: 0 0 0 4px rgba(40, 190, 217, .18); }
.nbms__field label {
    position: absolute; left: 15px; top: 15px; margin: 0;
    font-size: 15px; color: var(--nbms-muted); pointer-events: none;
    transform-origin: left top;
    transition: transform .2s ease, color .2s;
}
.nbms__field input:focus + label,
.nbms__field input:not(:placeholder-shown) + label { transform: translateY(-9px) scale(.74); color: var(--nbms-cyan-hover); font-weight: 700; }
.nbms__field.is-bad input { border-color: var(--nbms-red); background: #fff6f6; }
.nbms__field.is-bad input:focus { box-shadow: 0 0 0 4px rgba(179, 40, 45, .15); }
.nbms__field.is-bad label { color: var(--nbms-red); }
.nbms.is-open .nbms__field.is-bad { animation: nbms-shake .4s ease; }
@keyframes nbms-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.nbms__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.nbms__consent { position: relative; display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 2px; font-size: 12.5px; line-height: 1.45; color: var(--nbms-muted); cursor: pointer; }
.nbms__consent input { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; cursor: pointer; }
.nbms__box {
    flex: none; width: 20px; height: 20px; margin-top: 1px;
    border: 1.5px solid #b9c2d0; border-radius: 6px; background: #fff;
    display: grid; place-items: center;
    transition: background .2s, border-color .2s, transform .3s var(--nbms-spring);
}
.nbms__box::after {
    content: ""; width: 10px; height: 5px; margin-top: -3px;
    border: solid #fff; border-width: 0 0 2.5px 2.5px;
    transform: rotate(-45deg) scale(0); transition: transform .3s var(--nbms-spring);
}
.nbms__consent input:checked + .nbms__box { background: var(--nbms-cyan); border-color: var(--nbms-cyan); transform: scale(1.08); }
.nbms__consent input:checked + .nbms__box::after { transform: rotate(-45deg) scale(1); }
.nbms__consent input:focus-visible + .nbms__box { box-shadow: 0 0 0 4px rgba(40, 190, 217, .25); }
.nbms__consent.is-bad .nbms__box { border-color: var(--nbms-red); }
.nbms__consent a { color: var(--nbms-navy); text-decoration: underline; }

.nbms__btn {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; height: 50px; margin: 4px 0 0; padding: 0 20px;
    font: inherit; font-size: 16px; font-weight: 900; letter-spacing: .01em;
    color: #fff; background: var(--nbms-cyan);
    border: 0; border-radius: 50px; cursor: pointer;
    box-shadow: 0 8px 20px -8px rgba(40, 190, 217, .8);
    transition: background .2s, transform .2s, box-shadow .2s;
}
.nbms__btn::after { /* shine on hover */
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
    transform: skewX(-20deg); transition: left .6s ease;
}
.nbms__btn:hover { background: var(--nbms-cyan-hover); transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(40, 190, 217, .9); }
.nbms__btn:hover::after { left: 120%; }
.nbms__btn:active { transform: translateY(1px); }
.nbms__btn:focus-visible { outline: 2px solid var(--nbms-navy); outline-offset: 3px; }
.nbms__btn[disabled] { cursor: progress; }

.nbms__spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: nbms-spin .7s linear infinite; }
.nbms.is-sending .nbms__spinner { display: block; }
@keyframes nbms-spin { to { transform: rotate(360deg); } }

.nbms .nbms__msg { margin: 0; min-height: 0; font-size: 13px; font-weight: 700; color: var(--nbms-red); }
.nbms .nbms__msg:empty { display: none; }
.nbms .nbms__small { margin: 0; text-align: center; font-size: 12px; color: var(--nbms-muted); }

/* Two steps: a compact teaser first, then "Count me in" opens the form (keeps the pop-up small) */
.nbms__reveal { margin-top: 0; }
.nbms__form { display: none; }
.nbms.is-expanded .nbms__form { display: grid; animation: nbms-rise .45s var(--nbms-spring) both; }
.nbms.is-expanded .nbms__reveal, .nbms.is-expanded .nbms__intro { display: none; }
.nbms.is-expanded .nbms__perks { gap: 6px; margin-bottom: 14px; }
.nbms.is-expanded .nbms__perks li { font-size: 14px; }
.nbms.is-expanded .nbms__perks svg { width: 28px; height: 28px; padding: 5px; }

/* ---------- Success ---------- */
.nbms__done { display: none; text-align: center; padding: 10px 0 6px; outline: none; }
.nbms.is-done .nbms__pitch, .nbms.is-done .nbms__form { display: none; }
.nbms.is-done .nbms__done { display: block; animation: nbms-rise .6s var(--nbms-spring) both; }
.nbms .nbms__done h3 { margin: 12px 0 6px; font-size: 20px; font-weight: 900; color: var(--nbms-navy); }
.nbms .nbms__done p { margin: 0; font-size: 15px; color: var(--nbms-muted); }
.nbms__tick { width: 64px; height: 64px; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.nbms__tick circle { stroke: var(--nbms-cyan); stroke-dasharray: 151; stroke-dashoffset: 151; }
.nbms__tick path { stroke: var(--nbms-navy); stroke-dasharray: 36; stroke-dashoffset: 36; }
.nbms.is-done .nbms__tick circle { animation: nbms-draw .6s ease .1s forwards; }
.nbms.is-done .nbms__tick path { animation: nbms-draw .35s ease .6s forwards; }
@keyframes nbms-draw { to { stroke-dashoffset: 0; } }
@keyframes nbms-rise { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* ---------- Phones: a compact bottom sheet that opens into the form on tap ---------- */
@media (max-width: 600px) {
    .nbms, .nbms--left { --nbms-gap: 0px; top: auto; left: 0; right: 0; bottom: 0; display: block; width: 100%; max-width: none; }
    .nbms__card, .nbms--left .nbms__card { border-radius: 18px 18px 0 0; max-height: 88vh; transform-origin: 50% 100%; transform: translateY(100%); }
    .nbms.is-closing .nbms__card, .nbms--left.is-closing .nbms__card { transform: translateY(100%); }
    .nbms__head { padding: 16px 56px 16px 20px; }
    .nbms .nbms__title { font-size: 19px; margin-top: 9px; }
    .nbms__body { padding: 16px 20px calc(18px + env(safe-area-inset-bottom)); }
    .nbms .nbms__intro { display: none; }   /* the three perks carry the message on a phone */
    .nbms__perks { gap: 7px; margin-bottom: 14px; }
    .nbms__btn { height: 46px; }
    .nbms__perks li { font-size: 14px; }
    .nbms__perks svg { width: 28px; height: 28px; padding: 5px; }
    .nbms.is-expanded .nbms__perks { display: none; }   /* on a phone, the form alone */
}

/* Short screens (small laptops): tighten up the open form */
@media (max-height: 720px) and (min-width: 601px) {
    .nbms.is-expanded .nbms__perks { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .nbms *, .nbms *::before, .nbms *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
    .nbms__card { transform: none !important; }
    .nbms__tick circle, .nbms__tick path { stroke-dashoffset: 0; }
}

/* ---------- On-page version (chunk nbm.signup.page): sits in the page, always open ---------- */
.nbms.nbms--page {
    position: relative; top: auto; right: auto; bottom: auto; left: auto; z-index: auto;
    display: block; width: auto; max-width: 760px; margin: 0 0 30px;
    pointer-events: auto; perspective: none;
}
.nbms--page .nbms__card {
    opacity: 1; transform: none; transition: none;
    max-height: none; overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 18px 50px -18px rgba(0, 22, 71, .35), 0 1px 4px rgba(0, 22, 71, .1);
}
.nbms--page .nbms__head { padding: 28px 32px; }
.nbms--page.nbms .nbms__title { font-size: 28px; }
.nbms--page .nbms__body {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px 36px; align-items: start; padding: 28px 32px 30px;
}
.nbms--page.nbms .nbms__intro { display: block; font-size: 16px; }
.nbms--page .nbms__perks { gap: 14px; margin: 0; }
.nbms--page .nbms__form { display: grid; }
.nbms--page.is-done .nbms__body { display: block; }
.nbms--page .nbms__done { padding: 20px 0; }
@media (max-width: 600px) {
    .nbms.nbms--page { margin: 0 0 24px; }
    .nbms--page .nbms__card { border-radius: 14px; transform: none; max-height: none; }
    .nbms--page .nbms__head { padding: 20px; }
    .nbms--page.nbms .nbms__title { font-size: 22px; }
    .nbms--page .nbms__body { padding: 20px; gap: 20px; }
    .nbms--page.nbms .nbms__intro { display: block; }
}
