/* ==========================================================================
   Nometric navbar — shared by the WHMCS theme and the marketing site.
   Source of truth: whmcs/templates/nometric/css/nm-nav.css
   (site/build.py copies it to site/public/assets/css/nav.css).
   Relies on the --nm-* tokens defined by each stylesheet.
   ========================================================================== */

.nv {
    --nv-h: 72px;
    --nv-max: 1240px;
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid var(--nm-line);
    font-family: var(--nm-font);
    transition: box-shadow .2s;
}
/* The translucent blur lives on a pseudo-element: backdrop-filter on .nv itself would
   become the containing block for the fixed-position drawer and scrim. */
.nv::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: saturate(1.5) blur(14px);
    backdrop-filter: saturate(1.5) blur(14px);
    transition: background .2s;
}
.nv.is-scrolled { box-shadow: 0 8px 30px rgba(13, 17, 23, .07); }
.nv.has-open::before, .nv.is-menu-open::before { background: var(--nm-surface); }

.nv-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: var(--nv-max);
    height: var(--nv-h);
    margin: 0 auto;
    padding: 0 24px;
}

/* Brand */
.nv .nv-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
    margin-right: 20px;
    color: var(--nm-ink);
    font: 700 21px/1 var(--nm-display);
    letter-spacing: -.03em;
    text-decoration: none;
}
.nv .nv-brand:hover { color: var(--nm-ink); }
.nv-brand img, .nv-brand svg { display: block; }
.nv-brand .logo-img { max-height: 36px; width: auto; }

/* Top-level list */
.nv-menu { display: flex; align-items: center; flex: 1; min-width: 0; }
.nv-list { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nv-item { position: static; margin: 0; }

.nv .nv-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--nm-text);
    font: 500 15px/1 var(--nm-font);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.nv .nv-link:hover, .nv .nv-item.is-open > .nv-link { background: var(--nm-paper); color: var(--nm-ink); }
.nv .nv-link.is-current { color: var(--nm-ink); box-shadow: inset 0 -2px 0 var(--nm-accent); border-radius: 0; }
.nv-chev { width: 10px; height: 10px; flex: none; transition: transform .2s; opacity: .6; }
.nv-item.is-open > .nv-link .nv-chev { transform: rotate(180deg); opacity: 1; }

/* Mega panel */
.nv-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nm-surface);
    border-bottom: 1px solid var(--nm-line);
    box-shadow: 0 24px 48px rgba(13, 17, 23, .12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.nv-item.is-open > .nv-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .18s ease, transform .18s ease, visibility 0s;
}
.nv-panel-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 40px;
    max-width: var(--nv-max);
    margin: 0 auto;
    padding: 28px 24px 32px;
}
.nv-panel-head { margin: 0 0 14px 14px; }
.nv-panel-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--nv-cat, var(--nm-accent));
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.nv-panel-head p { margin: 4px 0 0; color: var(--nm-muted); font-size: 14px; }

.nv-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.nv-tiles.nv-tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nv .nv-tile {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    height: 100%;
    padding: 14px;
    border-radius: 12px;
    color: var(--nm-text);
    text-decoration: none;
    transition: background .15s;
}
.nv .nv-tile:hover, .nv .nv-tile:focus-visible { background: var(--nm-paper); color: var(--nm-text); }
.nv-tile-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 10px;
    background: color-mix(in srgb, var(--nv-cat, var(--nm-accent)) 12%, white);
    color: var(--nv-cat, var(--nm-accent));
    font-size: 16px;
}
.nv-tile-body { min-width: 0; }
.nv-tile strong { display: flex; align-items: center; gap: 6px; color: var(--nm-ink); font-size: 15px; font-weight: 600; line-height: 1.3; }
.nv-tile strong::after {
    content: "→";
    color: var(--nv-cat, var(--nm-accent));
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .15s, transform .15s;
}
.nv-tile:hover strong::after { opacity: 1; transform: none; }
.nv-tile-body > span { display: block; margin-top: 3px; color: var(--nm-muted); font-size: 13.5px; line-height: 1.45; }
.nv-tile em { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--nm-accent-soft); color: var(--nm-accent-text, #c93d0a); font-size: 11px; font-style: normal; font-weight: 600; }

/* Feature card in panel */
.nv-feature {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    overflow: hidden;
    border-radius: 16px;
    background:
        radial-gradient(400px 200px at 100% 0%, color-mix(in srgb, var(--nv-cat, var(--nm-accent)) 40%, transparent), transparent 70%),
        var(--nm-ink);
    color: var(--nm-on-ink-muted);
}
.nv-feature h3 { margin: 0 0 6px; color: var(--nm-on-ink); font: 600 19px/1.25 var(--nm-display); letter-spacing: -.01em; }
.nv-feature p { margin: 0; font-size: 14px; line-height: 1.5; }
.nv-feature-form { display: flex; gap: 6px; padding: 5px; border-radius: 10px; background: var(--nm-surface); }
.nv .nv-feature-form input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--nm-ink);
    font: 15px var(--nm-font);
    box-shadow: none;
}
.nv .nv-feature-form button, .nv .nv-feature-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--nm-accent);
    color: #fff;
    font: 600 14px/1 var(--nm-font);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.nv .nv-feature-cta { align-self: flex-start; }
.nv .nv-feature-form button:hover, .nv .nv-feature-cta:hover { background: var(--nm-accent-hover); color: #fff; }
.nv-feature-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.nv-feature-meta b { color: var(--nm-on-ink); font-weight: 600; }

/* Right-hand actions */
.nv-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.nv .nv-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--nm-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}
.nv .nv-status:hover { background: var(--nm-paper); color: var(--nm-ink); }
.nv-dot { position: relative; display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--nm-ok, #1fbf7a); }
.nv-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: nv-pulse 2s ease-out infinite; }
@keyframes nv-pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(2.8); opacity: 0; } }

.nv .nv-icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--nm-line);
    border-radius: 10px;
    background: var(--nm-surface);
    color: var(--nm-ink);
    text-decoration: none;
}
.nv .nv-icon-btn:hover { border-color: var(--nm-ink); color: var(--nm-ink); }
.nv-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid var(--nm-surface);
    border-radius: 9px;
    background: var(--nm-accent);
    color: #fff;
    font: 700 10px/14px var(--nm-font);
    text-align: center;
}
.nv-count.is-empty { display: none; }

.nv .nv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: 600 14px/1 var(--nm-font);
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.nv .nv-btn-ghost { color: var(--nm-ink); }
.nv .nv-btn-ghost:hover { background: var(--nm-paper); color: var(--nm-ink); }
.nv .nv-btn-primary { background: var(--nm-accent); border-color: var(--nm-accent); color: #fff; }
.nv .nv-btn-primary:hover { background: var(--nm-accent-hover); border-color: var(--nm-accent-hover); color: #fff; }
.nv .nv-btn-outline { border-color: var(--nm-line-strong); color: var(--nm-ink); }
.nv .nv-btn-outline:hover { border-color: var(--nm-ink); color: var(--nm-ink); }

/* Hamburger */
.nv-toggle {
    display: none;
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--nm-line);
    border-radius: 10px;
    background: var(--nm-surface);
    cursor: pointer;
}
.nv-toggle span, .nv-toggle span::before, .nv-toggle span::after {
    position: absolute;
    left: 50%;
    width: 16px;
    height: 1.75px;
    margin-left: -8px;
    border-radius: 2px;
    background: var(--nm-ink);
    transition: transform .2s, top .2s, opacity .2s;
}
.nv-toggle span { top: 50%; margin-top: -1px; }
.nv-toggle span::before, .nv-toggle span::after { content: ""; left: 0; margin-left: 0; }
.nv-toggle span::before { top: -5px; }
.nv-toggle span::after { top: 5px; }
.nv.is-menu-open .nv-toggle span { background: transparent; }
.nv.is-menu-open .nv-toggle span::before { top: 0; transform: rotate(45deg); }
.nv.is-menu-open .nv-toggle span::after { top: 0; transform: rotate(-45deg); }

.nv-menu-foot { display: none; }

/* Page dimmer while a panel is open */
.nv-scrim {
    position: fixed;
    inset: var(--nv-h) 0 0 0;
    z-index: -1;
    background: rgba(13, 17, 23, .28);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility 0s linear .2s;
}
.nv.has-open .nv-scrim { opacity: 1; visibility: visible; transition: opacity .2s, visibility 0s; }

.nv :focus-visible { outline: 2px solid var(--nm-accent); outline-offset: 2px; }
.nv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Medium desktops: hide less important actions */
@media (max-width: 1279.98px) {
    .nv-status-label { display: none; }
    .nv .nv-status { padding: 0 10px; }
}

/* ---------- Mobile drawer ---------- */
@media (max-width: 1023.98px) {
    .nv { --nv-h: 64px; }
    .nv-bar { padding: 0 16px; }
    .nv-toggle { display: inline-block; }
    .nv .nv-btn-ghost, .nv .nv-status { display: none; }

    .nv-menu {
        position: fixed;
        top: var(--nv-h);
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--nm-surface);
        border-top: 1px solid var(--nm-line);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity .2s, transform .2s, visibility 0s linear .2s;
    }
    .nv.is-menu-open .nv-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .2s, visibility 0s; }

    .nv-list { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px; }
    .nv-item { border-bottom: 1px solid var(--nm-line); }
    .nv .nv-link { width: 100%; height: 56px; justify-content: space-between; padding: 0 4px; border-radius: 0; font-size: 17px; font-weight: 600; }
    .nv .nv-link:hover, .nv .nv-item.is-open > .nv-link { background: transparent; }
    .nv .nv-link.is-current { box-shadow: none; color: var(--nm-accent-text, #c93d0a); }

    .nv-panel {
        position: static;
        display: none;
        border: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
    }
    .nv-item.is-open > .nv-panel { display: block; }
    .nv-panel-inner { display: block; padding: 0 0 12px; }
    .nv-panel-head { display: none; }
    .nv-tiles, .nv-tiles.nv-tiles-3 { grid-template-columns: 1fr; }
    .nv .nv-tile { padding: 10px 4px; }
    .nv-feature { margin-top: 10px; padding: 18px; }
    .nv-feature-hide-sm { display: none; }

    .nv-menu-foot { display: grid; gap: 10px; margin-top: auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--nm-line); background: var(--nm-paper); }
    .nv-menu-foot .nv-btn { width: 100%; height: 48px; font-size: 15px; }
    .nv-menu-foot-row { display: flex; justify-content: space-between; align-items: center; color: var(--nm-muted); font-size: 13px; }
    .nv-menu-foot-row a { color: var(--nm-ink); font-weight: 600; text-decoration: none; }

    .nv-scrim { display: none; }
    html.nv-lock, html.nv-lock body { overflow: hidden; }
}
@media (max-width: 479.98px) {
    .nv-actions .nv-btn-primary { padding: 0 12px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .nv *, .nv *::before, .nv *::after { transition: none !important; animation: none !important; }
}
