/* NPC Login Popover — presentation set by a class on .npc-lp-root: is-popover | is-modal (≥768) · is-sheet | is-full (≤767).
   Shops can tune --npc-lp-accent / --npc-lp-radius / --npc-lp-font in their theme. */
.npc-lp-root {
    --npc-lp-accent: #231f20;
    --npc-lp-accent-ink: #fff;
    --npc-lp-ink: #231f20;
    --npc-lp-muted: #6b6b6b;
    --npc-lp-line: #d9d9d9;
    --npc-lp-error: #b42318;
    --npc-lp-radius: 10px;
    --npc-lp-font: inherit;
    position: fixed;
    inset: 0;
    /* Above every theme/plugin overlay (floating accessibility/translator buttons use very high values). */
    z-index: 2147483000;
    display: none;
    font-family: var(--npc-lp-font);
    color: var(--npc-lp-ink);
}
.npc-lp-root.is-open { display: block; }

.npc-lp-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    transition: opacity .2s ease;
}
.npc-lp-root.is-shown .npc-lp-backdrop { opacity: 1; }
.npc-lp-root.is-popover .npc-lp-backdrop { background: rgba(0, 0, 0, .08); }
.npc-lp-root.is-full .npc-lp-backdrop { display: none; }

.npc-lp {
    position: absolute;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
    padding: 20px 22px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    outline: none;
}
.npc-lp *, .npc-lp *::before, .npc-lp *::after { box-sizing: border-box; }

/* Popover: 360 px card under the trigger; top/left set by the script. */
.npc-lp-root.is-popover .npc-lp {
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    border-radius: var(--npc-lp-radius);
    overflow: visible; /* keeps the arrow; the card is short enough not to need scrolling */
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease;
}
.npc-lp-root.is-popover.is-shown .npc-lp { opacity: 1; transform: none; }
.npc-lp-arrow { display: none; }
.npc-lp-root.is-popover .npc-lp-arrow {
    display: block;
    position: absolute;
    top: -7px;
    left: var(--npc-lp-arrow-x, 50%);
    width: 14px;
    height: 14px;
    margin-left: -7px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: -3px -3px 6px rgba(0, 0, 0, .05);
}
.npc-lp-root.is-popover.is-above .npc-lp-arrow { top: auto; bottom: -7px; box-shadow: 3px 3px 6px rgba(0, 0, 0, .05); }

/* Modal: centred card. */
.npc-lp-root.is-modal .npc-lp {
    top: 50%;
    left: 50%;
    width: 400px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    border-radius: var(--npc-lp-radius);
    opacity: 0;
    transform: translate(-50%, -48%);
    transition: opacity .18s ease, transform .18s ease;
}
.npc-lp-root.is-modal.is-shown .npc-lp { opacity: 1; transform: translate(-50%, -50%); }

/* Bottom sheet. */
.npc-lp-grab { display: none; }
.npc-lp-root.is-sheet .npc-lp {
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: 16px 16px 0 0;
    padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.npc-lp-root.is-sheet.is-shown .npc-lp { transform: none; }
.npc-lp-root.is-sheet .npc-lp-grab {
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 10px;
    border-radius: 2px;
    background: #cfcfcf;
}
/* the grab bar and title row drag the sheet down (npc-login-popover.js enableSheetSwipe): no browser panning there,
   and a taller invisible hit area round the 4px bar */
.npc-lp-root.is-sheet .npc-lp-grab,
.npc-lp-root.is-sheet .npc-lp-head { touch-action: none; cursor: grab; }
.npc-lp-root.is-sheet .npc-lp-grab { position: relative; }
.npc-lp-root.is-sheet .npc-lp-grab::before { content: ""; position: absolute; inset: -12px -40px; }

/* Full screen. */
.npc-lp-root.is-full .npc-lp {
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.npc-lp-root.is-full.is-shown .npc-lp { transform: none; }

.npc-lp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.npc-lp-title {
    margin: 0;
    font-family: var(--npc-lp-title-font, inherit);
    font-size: var(--npc-lp-title-size, 20px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    color: var(--npc-lp-ink);
}
.npc-lp-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: -8px -10px -8px 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--npc-lp-ink);
    cursor: pointer;
}
.npc-lp-close:hover { background: #f2f2f2; }

.npc-lp-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fdecea;
    color: var(--npc-lp-error);
    font-size: 14px;
    line-height: 1.4;
}
.npc-lp-error[hidden] { display: none; }

.npc-lp-form { display: flex; flex-direction: column; margin: 0; }
.npc-lp-label {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--npc-lp-ink);
    text-align: left;
}
.npc-lp-input {
    display: block;
    width: 100%;
    height: 46px;
    margin: 0 0 14px;
    padding: 0 12px;
    border: 1px solid var(--npc-lp-line);
    border-radius: 6px;
    background: #fff;
    color: var(--npc-lp-ink);
    font: inherit;
    font-size: 15px;
    line-height: normal;
    box-shadow: none;
}
.npc-lp-input:focus { border-color: var(--npc-lp-ink); outline: 2px solid transparent; box-shadow: 0 0 0 1px var(--npc-lp-ink); }
.npc-lp-pass { position: relative; }
.npc-lp-pass .npc-lp-input { padding-right: 52px; }
.npc-lp-toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--npc-lp-muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.npc-lp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -2px 0 16px;
    font-size: 14px;
}
.npc-lp-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; cursor: pointer; }
.npc-lp-check input { width: 16px; height: 16px; margin: 0; }
.npc-lp-forgot, .npc-lp-register a, .npc-lp-more { color: var(--npc-lp-ink); text-decoration: underline; text-underline-offset: 2px; }
.npc-lp-forgot { margin-left: auto; }

.npc-lp-submit {
    position: relative;
    height: 48px;
    border: 0;
    border-radius: 6px;
    background: var(--npc-lp-accent);
    color: var(--npc-lp-accent-ink);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
}
.npc-lp-submit:disabled { opacity: .75; cursor: progress; }
.npc-lp-submit.is-busy span { visibility: hidden; }
.npc-lp-submit.is-busy::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: npc-lp-spin .7s linear infinite;
}
@keyframes npc-lp-spin { to { transform: rotate(360deg); } }

/* eye / eye-off by state */
.npc-lp-toggle .npc-lp-eye-off,
.npc-lp-toggle[aria-pressed="true"] .npc-lp-eye { display: none; }
.npc-lp-toggle[aria-pressed="true"] .npc-lp-eye-off { display: block; }
.npc-lp-toggle:hover, .npc-lp-toggle:focus-visible { color: var(--npc-lp-ink); }
.npc-lp-foot { margin-top: 16px; font-size: 14px; text-align: center; color: var(--npc-lp-muted); }
/* the foot links were text-height tap targets (~18px) on phones */
.npc-lp-register a, .npc-lp-more { display: inline-flex; align-items: center; min-height: 44px; }
.npc-lp-forgot { display: inline-flex; align-items: center; min-height: 44px; }
.npc-lp-register { margin: 0 0 8px; }
.npc-lp-more { font-size: 13px; color: var(--npc-lp-muted); }

a[aria-busy="true"] { cursor: progress; }

/* Phones: 16 px inputs stop iOS from zooming. */
@media (max-width: 767px) {
    .npc-lp-input { font-size: 16px; }
}

html.npc-lp-lock, html.npc-lp-lock body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .npc-lp, .npc-lp-backdrop { transition: none !important; }
    .npc-lp-submit.is-busy::after { animation-duration: 1.6s; }
}
