/* หน้าเข้าแดชบอร์ด (nx-gate) + หน้าไม่พบเส้นทาง (nx-lost)
   ใช้ตัวแปรจาก nx-app.css; ไม่มีเมนูด้านซ้ายเพราะยังไม่ได้ login */

/* ===== พื้นหลังลายตาราง (ใช้ร่วมสองหน้า) ===== */
.nx-gate__scene, .nx-lost {
    background-color: var(--nx-bg);
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 44px 44px;
}
.nx-gate__glow {
    position: absolute;
    width: 620px;
    height: 620px;
    right: -160px;
    top: -200px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--nx-accent-glow), transparent 65%);
    opacity: .55;
    pointer-events: none;
}

/* ===== หน้าเข้าแดชบอร์ด ===== */
.nx-gate {
    display: grid;
    grid-template-columns: minmax(380px, 460px) 1fr;
    min-height: 100vh;
}

.nx-gate__pane {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 36px 48px 28px;
    background: var(--nx-surface);
    border-right: 1px solid var(--nx-border-soft);
}
.nx-gate__logo { height: 52px; }
.nx-gate__logo img { height: 100%; width: auto; max-width: 220px; object-fit: contain; border-radius: 10px; }

.nx-gate__body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.nx-gate__eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--nx-muted); }
.nx-gate__title { margin: 10px 0 6px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.nx-gate__lead { margin: 0 0 28px; color: var(--nx-muted); font-size: 14px; }

.nx-gate__form .nx-label { margin-top: 2px; }
.nx-field { position: relative; margin-bottom: 18px; }
.nx-field .form-control { height: 50px; padding-left: 44px; font-size: 15px; }
.nx-field__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nx-muted);
    font-size: 14px;
    pointer-events: none;
    transition: color .15s;
}
.nx-field:focus-within .nx-field__icon { color: var(--nx-accent); }
.nx-field__end {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--nx-muted);
    cursor: pointer;
}
.nx-field__end:hover, .nx-field__end.is-on { color: var(--nx-accent); background: var(--nx-accent-soft); }
.nx-field__end:focus { outline: none; box-shadow: 0 0 0 3px var(--nx-accent-soft); }
.nx-field input[type=password], .nx-field #password { padding-right: 52px; }

.nx-gate__submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 52px;
    margin-top: 8px;
    padding: 0 20px;
    font-size: 15px;
    box-shadow: 0 10px 30px var(--nx-accent-glow);
}
.nx-gate__submit i { transition: transform .2s; }
.nx-gate__submit:hover i { transform: translateX(4px); }
.nx-gate__submit:disabled { opacity: .7; cursor: progress; }

.nx-gate__foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--nx-muted); }

/* ด้านขวา: ภาพประกอบ */
.nx-gate__scene {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 36px;
    padding: 64px clamp(40px, 6vw, 96px);
}
.nx-gate__pitch { position: relative; max-width: 620px; }
.nx-gate__kicker { color: var(--nx-accent); font-size: 13px; margin-bottom: 12px; }
.nx-gate__pitch h2 { margin: 0; font-size: clamp(24px, 2.6vw, 36px); line-height: 1.35; font-weight: 700; letter-spacing: -.02em; }

.nx-gate__chart {
    position: relative;
    max-width: 720px;
    height: 240px;
    padding: 10px 0;
    border: 1px solid var(--nx-border-soft);
    border-radius: var(--nx-radius);
    background: rgba(17, 20, 27, .7);
    backdrop-filter: blur(4px);
}
.nx-gate__chart svg { display: block; width: 100%; height: 100%; }
.nx-gate__axis line { stroke: var(--nx-border); stroke-dasharray: 3 6; }
.nx-gate__stop-a { stop-color: var(--nx-accent); stop-opacity: .28; }
.nx-gate__stop-b { stop-color: var(--nx-accent); stop-opacity: 0; }
.nx-gate__area { fill: url(#nxGateFill); }
.nx-gate__line {
    fill: none;
    stroke: var(--nx-accent);
    stroke-width: 2.5;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 6px var(--nx-accent-glow));
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: nx-gate-draw 1.6s ease-out .2s forwards;
}
.nx-gate__line--dim { stroke: var(--nx-muted); stroke-width: 1.5; opacity: .45; filter: none; animation-delay: .5s; }
.nx-gate__dot { fill: var(--nx-accent); filter: drop-shadow(0 0 8px var(--nx-accent)); opacity: 0; animation: nx-gate-pulse 2s ease-in-out 1.8s infinite; }
@keyframes nx-gate-draw { to { stroke-dashoffset: 0; } }
@keyframes nx-gate-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.nx-gate__chips { position: relative; display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.nx-gate__chips li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--nx-border);
    border-radius: 999px;
    background: var(--nx-surface);
    color: var(--nx-text-2);
    font-size: 13px;
}
.nx-gate__chips i { color: var(--nx-accent); font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
    .nx-gate__line { animation: none; stroke-dashoffset: 0; }
    .nx-gate__dot { animation: none; opacity: 1; }
}

@media (max-width: 991px) {
    .nx-gate { grid-template-columns: 1fr; }
    .nx-gate__scene { display: none; }
    .nx-gate__pane {
        border-right: 0;
        padding: 28px 20px 24px;
        background-color: var(--nx-bg);
        background-image: radial-gradient(500px 300px at 100% 0, var(--nx-accent-soft), transparent 70%);
    }
    .nx-gate__body, .nx-gate__logo, .nx-gate__foot { width: 100%; max-width: 440px; margin: 0 auto; }
    .nx-gate__body { justify-content: flex-start; padding-top: 6vh; }
    .nx-gate__title { font-size: 26px; }
}

/* ===== หน้าไม่พบเส้นทาง ===== */
.nx-lost {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 16px;
    text-align: center;
}
.nx-lost .nx-gate__glow { right: auto; left: 50%; top: 50%; transform: translate(-50%, -60%); opacity: .35; }
.nx-lost__box { position: relative; max-width: 520px; }
.nx-lost__code {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: clamp(84px, 16vw, 132px);
    font-weight: 600;
    line-height: 1;
    color: var(--nx-text);
    text-shadow: 0 0 40px var(--nx-accent-glow);
}
.nx-lost__zero {
    display: grid;
    place-items: center;
    width: .78em;
    height: .9em;
    border: 3px solid var(--nx-accent);
    border-radius: .3em;
    color: var(--nx-accent);
    font-size: 1em;
    box-shadow: 0 0 30px var(--nx-accent-glow), inset 0 0 24px var(--nx-accent-soft);
}
.nx-lost__zero i { font-size: .32em; }
.nx-lost__tag {
    display: inline-block;
    margin: 22px 0 14px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--nx-accent-soft);
    color: var(--nx-accent);
    font-size: 12px;
    letter-spacing: .08em;
}
.nx-lost__title { margin: 0 0 8px; font-size: 24px; font-weight: 700; }
.nx-lost__lead { margin: 0 auto 26px; max-width: 420px; color: var(--nx-muted); }
.nx-lost__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.nx-lost__actions .btn { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; }
.nx-lost__foot { position: absolute; bottom: 20px; left: 0; right: 0; color: var(--nx-muted); font-size: 12px; letter-spacing: .06em; }
