/* ============================================================
 * navbar.css — site navbar + mobile quick-nav styles.
 * Extracted verbatim from partials/home/navbar.php (Phase 2:
 * separate concerns). Loaded from partials/home/head.php in the
 * SAME cascade position the inline <style> held, so rendering is
 * unchanged. Uses the --z-* scale from css/ebook.css :root.
 * ============================================================ */

    /* ── Mobile quick-nav (icon row under the navbar; mobile only) ── */
    .nav-mobile-quick { display: none; }
    .nmq-wrap { display: none; }
    .nav-slogan { display: none; }
    @media (max-width: 1024px) {
        /* Wrap holds the icon row + the slide-down login panel. The .navbar is
           position:fixed (80px tall) — sit this wrap right under it. */
        .nmq-wrap {
            display: block;
            position: fixed;
            top: 80px;
            left: 0;
            right: 0;
            z-index: var(--z-nav-panel);
            /* The divider sits at the very bottom of the whole header block, so any
               open panel (login / courses) shows ABOVE the line, not below it. */
            border-bottom: 3px solid #CBD5E1;
        }
        /* Keep the navbar at FULL height on scroll (mobile only). The desktop polish
           shrinks it 80px → 70px on scroll (.navbar.scrolled, css/index.css:217), but
           this icon bar is a separate fixed element pinned at top:80px. While the
           navbar height transitions 80→70, the two bars momentarily un-flush and a
           transparent gap flashes above the icons (page content shows through).
           Locking the height removes the cause entirely — and a stable-height header
           is the better call on mobile than a 10px shrink animation. */
        .navbar.scrolled,
        .navbar.scrolled .nav-container { height: 80px; }
        .nav-mobile-quick {
            display: flex;
            align-items: stretch;
            gap: 4px;
            padding: 9px 8px;
            background: #fff;
        }
        /* Hamburger removed on mobile (the icon bar replaces it); logo + slogan centered.
           Auth area (login button / dashboard / profile) is hidden too — the quick-nav
           "Account" handles login & dashboard — otherwise its button floats on tablet widths. */
        .navbar .menu-toggle { display: none !important; }
        .navbar .nav-auth-wrapper { display: none !important; }
        /* The empty desktop nav <ul> picks up a fixed white background at tablet widths
           and covers the top half of the logo — hide it on mobile (it has no items). */
        .navbar .nav-links { display: none !important; }
        .navbar .nav-container { flex-direction: column; justify-content: center; align-items: center; gap: 0; }
        .navbar .logo { line-height: 1; font-size: 2.3rem; }
        /* Merge the logo bar + icon menu into ONE seamless white block (NS-Mart style):
           solid white (no see-through two-tone), no divider line between logo & menu. */
        .navbar, .navbar.scrolled {
            background: #fff !important;
            border-bottom: 0 !important;
            box-shadow: none !important;
            -webkit-backdrop-filter: none !important;
            backdrop-filter: none !important;
        }
        .nav-slogan {
            display: block;
            font-family: 'Prompt', sans-serif;
            font-size: 0.72rem;
            font-weight: 600;
            letter-spacing: 0.06em;
            color: #2563EB;
            margin-top: 2px;
        }
        .nmq-item {
            flex: 1 1 0;
            display: flex; flex-direction: column; align-items: center; gap: 5px;
            padding: 6px 2px; border-radius: 14px; text-decoration: none;
            -webkit-tap-highlight-color: transparent;
            transition: background 0.18s ease, transform 0.15s ease;
        }
        .nmq-item:active { transform: translateY(1px); }
        .nmq-item:hover { background: rgba(37, 99, 235, 0.05); }
        /* NS-Mart style: plain solid gray icons (no colored circle) */
        .nmq-icon {
            font-size: 31px;
            line-height: 1;
            height: 34px;
            color: #64748B;
            display: inline-flex; align-items: center; justify-content: center;
            transition: color 0.18s ease;
        }
        .nmq-icon svg { width: 31px; height: 31px; }
        .nmq-label {
            font-family: 'Prompt', sans-serif; font-size: 0.72rem; font-weight: 700;
            letter-spacing: 0.03em; color: #475569; white-space: nowrap;
            text-transform: uppercase;
        }
        .nmq-item:hover .nmq-icon { color: #2563EB; }
        /* Account becomes a toggle button — reset native button look */
        .nmq-item.nmq-acct { -webkit-appearance: none; appearance: none; background: none; border: 0; cursor: pointer; font: inherit; }
        .nmq-wrap.show-login .nmq-acct .nmq-icon { color: #2563EB; }
        /* ── Slide-down login panel (revealed when Account is tapped) ── */
        .nmq-login {
            overflow: hidden;
            max-height: 0;
            background: #fff;
            /* close: snap up + fade (ease-in, a touch quicker) */
            transition: max-height 0.26s cubic-bezier(0.4, 0, 1, 1), opacity 0.18s ease-in, transform 0.26s cubic-bezier(0.4, 0, 1, 1);
        }
        .nmq-wrap.show-login .nmq-login {
            max-height: 360px; opacity: 1;
            /* open: smooth ease-out */
            transition: max-height 0.36s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.26s ease, transform 0.34s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .nmq-login-form {
            display: flex; flex-direction: column; gap: 10px;
            padding: 14px 16px 18px;
            max-width: 420px; margin: 0 auto;
        }
        .nmq-login-input {
            height: 44px; padding: 0 14px;
            border: 1px solid #CBD5E1; border-radius: 10px;
            font-size: 0.95rem; font-family: 'Sarabun', 'Prompt', sans-serif;
            background: #F8FAFC; color: #0F172A; outline: none;
            transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
        }
        .nmq-login-input::placeholder { color: #94A3B8; }
        .nmq-login-input:focus { border-color: #2563EB; background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
        .nmq-login-btn {
            height: 46px; border: 0; border-radius: 10px; cursor: pointer;
            background: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
            color: #fff; font-weight: 700; font-size: 0.98rem; font-family: 'Prompt', sans-serif;
            box-shadow: 0 6px 14px rgba(234, 88, 12, 0.30);
            transition: transform 0.12s ease, opacity 0.15s ease;
        }
        .nmq-login-btn:active { transform: translateY(1px); }
        .nmq-login-btn:disabled { opacity: 0.7; cursor: default; }
        .nmq-login-msg { font-size: 0.85rem; text-align: center; color: #DC2626; font-family: 'Prompt', sans-serif; }
        .nmq-login-msg.ok { color: #166534; }
        .nmq-login-input { width: 100%; box-sizing: border-box; }
        /* Forgot-password: the password field fades out + collapses → reset mode */
        .nmq-pass-wrap {
            overflow: hidden; max-height: 64px;
            transition: max-height 0.3s ease, opacity 0.22s ease, margin-top 0.3s ease;
        }
        .nmq-login-form[data-mode="reset"] .nmq-pass-wrap {
            max-height: 0; opacity: 0; margin-top: -10px; pointer-events: none;
        }
        .nmq-forgot {
            align-self: center;
            font-family: 'Prompt', sans-serif; font-size: 0.82rem; font-weight: 600;
            color: #2563EB; text-decoration: none; margin-top: 2px;
        }
        .nmq-forgot:hover { text-decoration: underline; }
        /* Courses toggle button — reset native button look */
        .nmq-item.nmq-courses-btn { -webkit-appearance: none; appearance: none; background: none; border: 0; cursor: pointer; font: inherit; }
        .nmq-wrap.show-courses .nmq-courses-btn .nmq-icon { color: #2563EB; }
        /* ── Slide-down Courses panel (blue category header + course list) ── */
        .nmq-courses {
            overflow: hidden;
            max-height: 0;
            background: #fff;
            /* close: snap up + fade (ease-in, a touch quicker) */
            transition: max-height 0.26s cubic-bezier(0.4, 0, 1, 1), opacity 0.18s ease-in, transform 0.26s cubic-bezier(0.4, 0, 1, 1);
        }
        .nmq-wrap.show-courses .nmq-courses {
            max-height: calc(100vh - 175px); max-height: calc(100dvh - 175px); opacity: 1;
            /* open: smooth ease-out */
            transition: max-height 0.36s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.26s ease, transform 0.34s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .nmq-cat-head {
            position: relative;
            background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
            color: #fff; text-align: center;
            font-family: 'Prompt', sans-serif; font-weight: 700; font-size: 1rem; letter-spacing: 0.02em;
            padding: 13px 16px;
        }
        /* downward "tail" triangle at the bottom-center (NS-Mart style) */
        .nmq-cat-head::after {
            content: '';
            position: absolute;
            left: 50%; bottom: -9px;
            transform: translateX(-50%);
            width: 0; height: 0;
            border-left: 11px solid transparent;
            border-right: 11px solid transparent;
            border-top: 9px solid #2563EB;
            z-index: 1;
        }
        /* glossy "shine" sweep across the blue header (clipped to its own box, so the
           triangle ::after is untouched — no overflow:hidden needed) */
        .nmq-cat-head::before {
            content: ''; position: absolute; inset: 0;
            background: linear-gradient(100deg, transparent 40%, rgba(255,255,255,0.45) 50%, transparent 60%);
            background-size: 250% 100%; background-position: 150% 0; background-repeat: no-repeat;
            animation: nmqHeadShine 3.6s ease-in-out infinite;
            pointer-events: none;
        }
        @keyframes nmqHeadShine {
            0%, 55% { background-position: 150% 0; }
            100%    { background-position: -50% 0; }
        }
        @media (prefers-reduced-motion: reduce) { .nmq-cat-head::before { animation: none; } }
        /* Scrollable list so all courses + the "see all" link are reachable on short
           screens. overflow:auto only kicks in AFTER the open animation (via .is-scrollable
           added by JS) so it can't cause the clip-edge flicker during the slide. */
        .nmq-course-list { max-height: calc(100vh - 227px); max-height: calc(100dvh - 227px); }
        .nmq-courses.is-scrollable .nmq-course-list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
        .nmq-course-item {
            display: flex; align-items: center; gap: 13px;
            padding: 12px 16px; text-decoration: none;
            border-bottom: 1px solid #EEF2F6; transition: background 0.15s ease;
        }
        .nmq-course-item:hover, .nmq-course-item:active { background: #F1F5FF; }
        .nmq-course-thumb {
            flex-shrink: 0; width: 68px; height: 68px;
            border-radius: 11px; overflow: hidden;
            background: #EEF2F6; border: 1px solid #E8EDF3;
        }
        .nmq-course-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
        .nmq-course-title { flex: 1; min-width: 0; font-family: 'Prompt', sans-serif; font-size: 0.9rem; font-weight: 600; color: #1E293B; line-height: 1.32; }
        .nmq-course-right { flex-shrink: 0; display: flex; align-items: center; gap: 7px; }
        .nmq-course-price { font-family: 'Prompt', sans-serif; font-size: 0.86rem; font-weight: 700; color: #EA580C; white-space: nowrap; }
        .nmq-course-arrow { color: #94A3B8; font-size: 0.78rem; }
        .nmq-course-item:hover .nmq-course-arrow, .nmq-course-item:active .nmq-course-arrow { color: #2563EB; }
        .nmq-course-all {
            display: flex; align-items: center; justify-content: center; gap: 7px;
            padding: 13px 18px; text-decoration: none;
            font-family: 'Prompt', sans-serif; font-size: 0.9rem; font-weight: 700; color: #2563EB; background: #F8FAFC;
        }
        .nmq-course-all:hover, .nmq-course-all:active { background: #EEF2F6; }
        /* ── Slide-down Contact panel (blue header + form → email) ── */
        .nmq-item.nmq-contact-btn { -webkit-appearance: none; appearance: none; background: none; border: 0; cursor: pointer; font: inherit; }
        .nmq-wrap.show-contact .nmq-contact-btn .nmq-icon { color: #2563EB; }
        .nmq-contact {
            overflow: hidden; max-height: 0; background: #fff;
            transition: max-height 0.26s cubic-bezier(0.4, 0, 1, 1);
        }
        .nmq-wrap.show-contact .nmq-contact {
            max-height: calc(100vh - 175px); max-height: calc(100dvh - 175px);
            transition: max-height 0.42s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .nmq-contact-country { cursor: pointer; color: #0F172A; }
        /* Glossy "shine" sweep — Account login/reset button (orange) + Contact send button (blue) */
        #nmqLoginBtn, #nmqcBtn { position: relative; overflow: hidden; }
        #nmqcBtn {
            background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
            box-shadow: 0 6px 16px rgba(37, 99, 235, 0.38);
        }
        #nmqLoginBtn::before, #nmqcBtn::before {
            content: ''; position: absolute; inset: 0 0 50% 0;
            background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0));
            pointer-events: none;
        }
        #nmqLoginBtn::after, #nmqcBtn::after {
            content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
            background: linear-gradient(110deg, transparent, rgba(255,255,255,0.55), transparent);
            transform: translateX(-220%) skewX(-20deg);
            animation: nmqShine 3.6s ease-in-out infinite;
            pointer-events: none;
        }
        @keyframes nmqShine {
            0%, 55% { transform: translateX(-220%) skewX(-20deg); }
            100%    { transform: translateX(420%) skewX(-20deg); }
        }
        @media (prefers-reduced-motion: reduce) { #nmqLoginBtn::after, #nmqcBtn::after { display: none; } }
        /* ── Slide-down About panel ── */
        .nmq-item.nmq-about-btn { -webkit-appearance: none; appearance: none; background: none; border: 0; cursor: pointer; font: inherit; }
        .nmq-wrap.show-about .nmq-about-btn .nmq-icon { color: #2563EB; }
        .nmq-about {
            overflow: hidden; max-height: 0; background: #fff;
            transition: max-height 0.26s cubic-bezier(0.4, 0, 1, 1);
        }
        .nmq-wrap.show-about .nmq-about {
            max-height: calc(100vh - 175px); max-height: calc(100dvh - 175px);
            transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .nmq-about-body { padding: 16px 18px 18px; max-width: 560px; margin: 0 auto; }
        .nmq-about-title { font-family: 'Prompt', sans-serif; font-size: 1.05rem; font-weight: 700; color: #1E293B; margin: 0 0 10px; }
        .nmq-about-body p { font-family: 'Sarabun', 'Prompt', sans-serif; font-size: 0.92rem; line-height: 1.7; color: #475569; margin: 0 0 10px; }
        .nmq-about-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; text-decoration: none; font-family: 'Prompt', sans-serif; font-weight: 700; font-size: 0.9rem; color: #2563EB; }
        .nmq-about-cta:hover { text-decoration: underline; }
        .nmq-contact-form {
            display: flex; flex-direction: column; gap: 10px;
            padding: 14px 16px 18px; max-width: 440px; margin: 0 auto;
        }
        .nmq-contact-msg {
            height: auto; min-height: 86px; padding: 10px 14px; resize: none;
            line-height: 1.5; font-family: 'Sarabun', 'Prompt', sans-serif;
        }
        .nmq-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
        /* Contact fields: stacked + placeholder-only on phones */
        .nmq-field { display: flex; flex-direction: column; }
        .nmq-field[hidden] { display: none !important; }
        .nmq-field > label { display: none; }
        /* Tablet / iPad (≥600px wide): show the label on the LEFT of each field */
        @media (min-width: 600px) {
            .nmq-contact-form { max-width: 600px; }
            .nmq-contact-form .nmq-field { flex-direction: row; align-items: flex-start; gap: 12px; }
            .nmq-contact-form .nmq-field > label {
                display: block; width: 96px; flex-shrink: 0; text-align: right; padding-top: 12px;
                font-family: 'Prompt', sans-serif; font-size: 0.88rem; font-weight: 600; color: #334155;
            }
            .nmq-contact-form .nmq-field > .nmq-login-input { flex: 1; min-width: 0; }
            .nmq-contact-form > .nmq-login-btn,
            .nmq-contact-form > .nmq-login-msg { margin-left: 108px; }
        }
        /* The fixed navbar + this fixed quick-nav wrap overlay the top of the hero.
           Push the hero content down so the badge + heading clear the icon bar. */
        .hero.hero-home { padding-top: 192px; }
    }
    @media (max-width: 380px) {
        .nav-mobile-quick .nmq-label { font-size: 0.64rem; }
        .nav-mobile-quick .nmq-icon { font-size: 27px; }
        .nav-mobile-quick .nmq-icon svg { width: 27px; height: 27px; }
    }

    /* ── Inline navbar login form — desktop only ── */
    .nav-auth-wrapper { position: relative; }
    .nav-inline-login {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    /* ── Entrance stagger — fields fade in one-by-one when navbar mounts.
         Tiny detail but communicates "this is crafted" on first impression. ── */
    .nav-inline-login > * {
        opacity: 0;
        animation: navLiFieldIn 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }
    .nav-inline-login > *:nth-child(1) { animation-delay: 0.05s; }
    .nav-inline-login > *:nth-child(2) { animation-delay: 0.12s; }
    .nav-inline-login > *:nth-child(3) { animation-delay: 0.19s; }
    .nav-inline-login > *:nth-child(4) { animation-delay: 0.26s; }
    @keyframes navLiFieldIn {
        from { opacity: 0; transform: translateY(-6px); }
        to   { opacity: 1; }
    }
    /* ── Email "valid" sparkle — green ✓ appears when format becomes correct ── */
    .nav-li-email-sparkle {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%) scale(0) rotate(-45deg);
        width: 18px;
        height: 18px;
        color: #16A34A;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .nav-li-email-sparkle.is-on {
        transform: translateY(-50%) scale(1) rotate(0deg);
        opacity: 1;
    }
    .nav-li-email-sparkle svg { width: 100%; height: 100%; display: block; }
    .nav-li-input {
        height: 38px;
        padding: 0 12px;
        border: 1px solid #CBD5E1;
        border-radius: 8px;
        font-size: 0.85rem;
        font-family: 'Sarabun', 'Prompt', sans-serif;
        background: #F8FAFC;
        color: #0F172A;
        outline: none;
        /* width/opacity/padding here are part of the reset-mode morph transition below */
        transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.22s ease,
                    padding 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                    margin 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                    border-color 0.15s ease,
                    background 0.15s ease,
                    box-shadow 0.15s ease;
    }
    .nav-li-input::placeholder { color: #94A3B8; }
    .nav-li-input:focus {
        border-color: #2563EB;
        background: #FFFFFF;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
        /* ── Subtle "breathing" focus glow — premium signal that field is alive ── */
        animation: navLiFocusPulse 2.4s ease-in-out infinite;
    }
    @keyframes navLiFocusPulse {
        0%, 100% { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
        50%      { box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.22); }
    }
    /* Invalid email feedback — set by JS on blur if format is wrong */
    .nav-li-input.is-invalid {
        border-color: #EF4444;
        background: #FEF2F2;
    }
    .nav-li-input.is-invalid:focus {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
    }
    /* Email lives inside a wrapper that owns the width (matches pw-wrap pattern).
       The wrapper hosts the validation sparkle ✓ positioned absolutely on the right. */
    .nav-li-email-wrap {
        position: relative;
        display: inline-flex;
        width: 240px;
        transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .nav-li-email {
        width: 100%;
        padding-right: 34px;             /* room for the sparkle */
    }
    /* Password input now lives inside a wrapper to host the eye-toggle button.
       The wrapper owns the width + collapse transitions; the input fills 100%. */
    .nav-li-pw-wrap {
        position: relative;
        display: inline-flex;
        width: 120px;
        transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.22s ease,
                    margin 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .nav-li-pw {
        width: 100%;
        padding-right: 34px;            /* room for the eye toggle on the right */
    }
    .nav-li-pw-toggle {
        position: absolute;
        right: 4px;
        top: 50%;
        transform: translateY(-50%);
        width: 28px;
        height: 28px;
        padding: 0;
        border: none;
        background: transparent;
        color: #94A3B8;
        cursor: pointer;
        border-radius: 6px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: color 0.15s ease, background 0.15s ease;
    }
    .nav-li-pw-toggle:hover {
        color: #475569;
        background: rgba(15, 23, 42, 0.05);
    }
    .nav-li-pw-toggle:focus-visible {
        outline: 2px solid rgba(37, 99, 235, 0.35);
        outline-offset: 1px;
    }
    .nav-li-pw-icon { width: 16px; height: 16px; display: block; }
    .nav-li-pw-icon[hidden] { display: none; }

    /* ── Reset mode: pw-wrap collapses, email expands to fill exactly its old space.
         Total horizontal extent stays the same → orange button stays anchored ── */
    .nav-inline-login[data-mode="reset"] .nav-li-pw-wrap {
        width: 0;
        opacity: 0;
        margin-left: -6px;          /* eat the parent flex gap so collapse is seamless */
        overflow: hidden;            /* hide the eye toggle button too */
        pointer-events: none;
    }
    .nav-inline-login[data-mode="reset"] .nav-li-email-wrap {
        width: 366px;                /* = 240 + 6 (gap) + 120 (pw) → reaches old pw's end */
    }
    @media (max-width: 1180px) {
        .nav-li-email-wrap { width: 200px; }
        .nav-li-pw-wrap { width: 105px; }
        .nav-inline-login[data-mode="reset"] .nav-li-email-wrap { width: 311px; } /* 200 + 6 + 105 */
    }
    .nav-inline-login[data-mode="reset"] .nav-li-forgot {
        color: #2563EB;
        font-weight: 700;
    }
    .nav-li-submit {
        height: 40px;                    /* +2px for a more substantial feel */
        min-width: 138px;                /* fits both "เข้าสู่ระบบ" & "ส่งลิงก์รีเซ็ต" — no width jump */
        padding: 0 18px;
        border: 1px solid rgba(122, 60, 0, 0.22);
        border-radius: 10px;
        /* 3-stop gradient — bright top, warm mid, deep bottom — adds depth */
        background:
            linear-gradient(180deg, rgba(255, 251, 235, 0.18) 0%, transparent 50%),
            linear-gradient(135deg, #FB923C 0%, #F97316 45%, #EA580C 100%);
        color: #422006 !important;       /* dark brown — !important defeats any cascading button color */
        font-size: 0.84rem;
        font-weight: 800;
        font-family: 'Sarabun', 'Prompt', sans-serif;
        letter-spacing: 0.3px;
        text-shadow: 0 1px 0 rgba(255, 251, 235, 0.35);  /* tiny emboss for crispness */
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        white-space: nowrap;
        position: relative;
        overflow: hidden;                /* clips the shine effect */
        /* Multi-layer shadow — premium depth */
        box-shadow:
            inset 0 1px 0 rgba(255, 251, 235, 0.55),   /* top highlight (glassy) */
            inset 0 -1px 0 rgba(122, 60, 0, 0.18),     /* bottom inner shade */
            0 5px 14px rgba(249, 115, 22, 0.34),       /* main soft glow */
            0 1px 3px rgba(15, 23, 42, 0.12);          /* tight contact shadow */
        transition:
            filter 0.2s ease,
            transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
            box-shadow 0.25s ease;
    }
    /* Diagonal shine sweep on hover — Stripe/Linear-style premium accent */
    .nav-li-submit::before {
        content: '';
        position: absolute;
        top: 0;
        left: -130%;
        width: 60%;
        height: 100%;
        background: linear-gradient(110deg,
            transparent 0%,
            rgba(255, 251, 235, 0.38) 50%,
            transparent 100%);
        pointer-events: none;
        transition: left 0.65s cubic-bezier(0.25, 0.1, 0.25, 1);
    }
    .nav-li-submit:hover::before { left: 130%; }
    .nav-li-submit:hover {
        filter: brightness(1.04) saturate(1.08);
        transform: translateY(-1.5px);
        box-shadow:
            inset 0 1px 0 rgba(255, 251, 235, 0.65),
            inset 0 -1px 0 rgba(122, 60, 0, 0.20),
            0 10px 22px rgba(249, 115, 22, 0.42),
            0 2px 6px rgba(15, 23, 42, 0.14);
    }
    .nav-li-submit:active {
        transform: translateY(0.5px);
        box-shadow:
            inset 0 1px 0 rgba(255, 251, 235, 0.30),
            inset 0 -1px 0 rgba(122, 60, 0, 0.25),
            0 3px 8px rgba(249, 115, 22, 0.26);
    }
    .nav-li-submit:disabled {
        opacity: 0.72;
        cursor: wait;
        transform: none;
        box-shadow:
            inset 0 1px 0 rgba(255, 251, 235, 0.30),
            0 3px 8px rgba(249, 115, 22, 0.20);
    }
    .nav-li-submit:disabled::before { display: none; }
    .nav-li-label { display: inline-block; color: inherit; }
    /* Force text color inheritance on all inner spans — defensive against any
       global span color cascade (some themes set span color globally) */
    .nav-li-submit .nav-li-label,
    .nav-li-submit .nav-li-loader,
    .nav-li-submit .nav-li-loader span { color: #422006 !important; }
    /* ── Critical: [hidden] override must beat the display rules above ──
         Without these, setting el.hidden=true has no effect because the
         explicit `display: inline-block/inline-flex` overrides the implicit
         `display: none` that `hidden` would otherwise set. */
    .nav-li-label[hidden],
    .nav-li-loader[hidden] { display: none !important; }

    /* ── Loading state — CSS spinner replacing the emoji ⏳ ── */
    .nav-li-loader {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        font-size: 0.82rem;
    }
    .nav-li-spinner {
        width: 14px;
        height: 14px;
        border: 2px solid rgba(66, 32, 6, 0.22);
        border-top-color: #422006;
        border-radius: 50%;
        animation: navLiSpin 0.65s linear infinite;
        flex-shrink: 0;
    }
    @keyframes navLiSpin {
        to { transform: rotate(360deg); }
    }

    /* ═══════════════════════════════════════════════════════════
       INLINE LOGIN PROGRESS — replaces the form in-place after success
       Sits in the same .nav-auth-wrapper, takes ~528px wide (same as form)
       so there's zero layout shift when it slides in.
       ═══════════════════════════════════════════════════════════ */
    .nav-li-progress {
        display: inline-flex;
        align-items: center;
        gap: 12px;
        height: 40px;                               /* same as button */
        padding: 0 14px;
        min-width: 598px;                           /* matches form total width (email 240 + pw 120 + button 138 + gaps + ~link space) */
        background: linear-gradient(180deg, #FFFFFF 0%, #FCFAF5 100%);
        border: 1px solid rgba(200, 150, 46, 0.30);
        border-radius: 10px;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.7),
            0 2px 10px rgba(200, 150, 46, 0.15),
            0 1px 3px rgba(15, 23, 42, 0.08);
        animation: navLiProgressIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .nav-li-progress[hidden] { display: none !important; }
    .nav-li-progress-icon {
        font-size: 1.15rem;
        line-height: 1;
        flex-shrink: 0;
        animation: navLiProgressIconPulse 1.4s ease-in-out infinite;
    }
    .nav-li-progress-body {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .nav-li-progress-text {
        font-family: 'Sarabun', 'Prompt', sans-serif;
        font-size: 0.78rem;
        font-weight: 700;
        color: #422006;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: opacity 0.2s ease;
    }
    .nav-li-progress-track {
        height: 5px;
        background: rgba(200, 150, 46, 0.15);
        border-radius: 100px;
        overflow: hidden;
        box-shadow: inset 0 1px 1px rgba(122, 60, 0, 0.10);
    }
    .nav-li-progress-bar {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, #C8962E 0%, #E0B349 50%, #C8962E 100%);
        background-size: 200% 100%;
        border-radius: 100px;
        transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
        animation: navLiProgressShimmer 1.5s linear infinite;
    }
    .nav-li-progress-pct {
        font-family: 'Sarabun', 'Prompt', sans-serif;
        font-size: 0.85rem;
        font-weight: 800;
        color: #422006;
        font-variant-numeric: tabular-nums;
        min-width: 38px;
        text-align: right;
        flex-shrink: 0;
    }
    @keyframes navLiProgressIn {
        from { opacity: 0; transform: translateX(6px); }
        to   { opacity: 1; transform: translateX(0); }
    }
    @keyframes navLiProgressShimmer {
        to { background-position: -200% 0; }
    }
    @keyframes navLiProgressIconPulse {
        0%, 100% { transform: scale(1); }
        50%      { transform: scale(1.12); }
    }
    @media (max-width: 1180px) {
        .nav-li-progress { min-width: 510px; }
    }
    .nav-li-forgot {
        font-size: 0.78rem;
        color: #64748B;
        text-decoration: none;
        margin-left: 8px;
        white-space: nowrap;
        font-weight: 600;
        transition: color 0.15s ease;
    }
    .nav-li-forgot:hover { color: #2563EB; text-decoration: underline; }
    .nav-li-msg {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        padding: 9px 14px;
        border-radius: 8px;
        font-size: 0.82rem;
        font-weight: 600;
        background: #FEE2E2;
        color: #991B1B;
        border: 1px solid #FCA5A5;
        z-index: var(--z-nav-toast);
        max-width: 360px;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
        animation: navLiMsgIn 0.18s ease;
    }
    .nav-li-msg.is-success {
        background: #DCFCE7;
        color: #166534;
        border-color: #86EFAC;
    }
    @keyframes navLiMsgIn {
        from { opacity: 0; transform: translateY(-4px); }
        to   { opacity: 1; }
    }
    /* Mobile fallback button — hidden on desktop, shown when inline form collapses */
    .nav-li-mobile-btn { display: none; }

    /* Narrower viewport — link text already shortened by JS via data-text-short */
    /* (≤1180px also shrinks input widths — see the .nav-li-email override block above) */
    /* On mobile, hide inline form + show fallback button */
    @media (max-width: 1024px) {
        .nav-inline-login { display: none; }
        .nav-li-msg { display: none; }
        .nav-li-mobile-btn { display: inline-flex; }
    }
