/* ═══════════════════════════════════════════════════════
   Nebrix — หน้าแรก (/) + หน้าเข้าสู่ระบบ Hub / ผู้ดูแลแพลตฟอร์ม · 0.19.0
   ใช้ตัวแปรธีมของ nebrix-admin.css + nebrix-hub.css · ธีมมืดเป็นค่าเริ่มต้น · html.light = สว่าง
═══════════════════════════════════════════════════════ */
:root {
    --np-brand: #534AB7;
    --np-brand-2: #7B72E0;
    --np-ink: #0F1222;
    --np-card: rgba(255,255,255,.035);
    --np-glow: radial-gradient(60% 60% at 70% 20%, rgba(123,114,224,.28) 0%, rgba(123,114,224,0) 70%);
}
html.light {
    --np-card: #ffffff;
    --np-glow: radial-gradient(60% 60% at 70% 20%, rgba(83,74,183,.14) 0%, rgba(83,74,183,0) 70%);
}

.np-land { height: 100vh; overflow-y: auto; scroll-behavior: smooth; background: var(--bg); color: var(--tx); font-family: var(--font); font-size: 15px; line-height: 1.6; }
.np-land a { text-decoration: none; }
.np-land :focus-visible, .np-auth :focus-visible { outline: 2px solid var(--np-brand-2); outline-offset: 2px; border-radius: 8px; }
/* FocusOnNavigate (Routes.razor) โฟกัส h1 ให้ screen reader — ไม่ต้องแสดงกรอบ */
.np-land h1:focus, .np-auth h1:focus { outline: none; }
.np-wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* body ของแอปเป็น overflow:hidden (โครง Admin) — หน้าแรก/หน้าเข้าสู่ระบบจึงเลื่อนในกล่องของตัวเอง */

/* ── แถบบน ── */
.np-top { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(140%) blur(10px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--b1); }
.np-top .np-wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.np-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--tx); font-weight: 700; letter-spacing: -.2px; }
.np-logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--np-brand) 0%, var(--np-brand-2) 100%); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; box-shadow: 0 6px 16px rgba(83,74,183,.35); }
.np-brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .2px; }
.np-nav { display: flex; gap: 22px; margin-left: 12px; }
.np-nav a { color: var(--muted); font-size: 14px; font-weight: 500; }
.np-nav a:hover { color: var(--tx); }
.np-top-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ── ปุ่ม ── */
.np-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 10px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s, transform .15s, box-shadow .15s; white-space: nowrap; }
.np-btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.np-btn-lg { height: 50px; padding: 0 26px; font-size: 16px; border-radius: 12px; }
.np-btn-primary { background: var(--np-brand); color: #fff !important; box-shadow: 0 8px 20px rgba(83,74,183,.32); }
.np-btn-primary:hover { background: #463EA0; transform: translateY(-1px); }
.np-btn-ghost { background: transparent; color: var(--tx) !important; border-color: var(--b2); }
.np-btn-ghost:hover { background: var(--s2); }

/* ── Hero ── */
.np-hero { position: relative; overflow: hidden; }
.np-hero::before { content: ""; position: absolute; inset: 0; background: var(--np-glow); pointer-events: none; }
.np-hero .np-wrap { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 80px; }
.np-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--nh-accent-tx); background: var(--nh-accent-soft); border: 1px solid color-mix(in srgb, var(--np-brand-2) 35%, transparent); border-radius: 999px; padding: 5px 12px; }
.np-kicker i { width: 7px; height: 7px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 3px rgba(52,211,153,.2); }
.np-h1 { font-size: clamp(32px, 4.2vw, 50px); line-height: 1.18; letter-spacing: -1px; font-weight: 800; margin: 18px 0 16px; }
.np-h1 em { font-style: normal; background: linear-gradient(90deg, var(--np-brand-2), #4FB3E8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.np-lead { font-size: 17px; color: var(--muted); max-width: 540px; margin: 0 0 28px; }
.np-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.np-fine { margin-top: 14px; font-size: 13px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }
.np-fine span::before { content: "✓"; color: #34D399; font-weight: 700; margin-right: 6px; }

/* ── ภาพตัวอย่าง (mock หน้าภาพรวม) ── */
.np-preview { background: var(--surface); border: 1px solid var(--b2); border-radius: 18px; box-shadow: var(--nh-shadow); overflow: hidden; }
.np-pv-bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--b1); background: var(--s2); }
.np-pv-bar b { width: 10px; height: 10px; border-radius: 50%; background: var(--b3); }
.np-pv-bar span { margin-left: 10px; font-size: 12px; color: var(--muted); }
.np-pv-body { padding: 18px; display: grid; gap: 10px; }
.np-pv-hello { font-size: 13px; color: var(--muted); }
.np-pv-hello b { display: block; font-size: 17px; color: var(--tx); }
.np-pv-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--b1); border-radius: 12px; background: var(--np-card); }
.np-pv-row .np-ic { width: 34px; height: 34px; font-size: 13px; border-radius: 9px; }
.np-pv-row div { flex: 1; min-width: 0; }
.np-pv-row strong { display: block; font-size: 14px; }
.np-pv-row small { color: var(--muted); font-size: 12px; }
.np-chip { font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 10px; background: var(--nh-ok-bg); color: var(--nh-ok-tx); }
.np-chip.trial { background: var(--nh-accent-soft); color: var(--nh-accent-tx); }
.np-pv-ai { padding: 12px; border-radius: 12px; background: linear-gradient(135deg, rgba(83,74,183,.18), rgba(79,179,232,.12)); border: 1px solid color-mix(in srgb, var(--np-brand-2) 30%, transparent); font-size: 13px; }
.np-pv-ai .np-meter { height: 6px; border-radius: 999px; background: var(--b1); margin-top: 8px; overflow: hidden; }
.np-pv-ai .np-meter i { display: block; height: 100%; width: 64%; background: linear-gradient(90deg, var(--np-brand-2), #4FB3E8); border-radius: inherit; }

/* ── หัวข้อส่วน ── */
.np-sec { padding: 72px 0; border-top: 1px solid var(--b1); }
.np-sec-head { max-width: 640px; margin-bottom: 32px; }
.np-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--nh-accent-tx); }
.np-h2 { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -.5px; font-weight: 800; margin: 8px 0 10px; line-height: 1.25; }
.np-sub { color: var(--muted); margin: 0; }

/* ── ผลิตภัณฑ์ ── */
.np-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.np-prod { background: var(--np-card); border: 1px solid var(--b1); border-radius: 16px; padding: 20px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.np-prod:hover { border-color: var(--b3); transform: translateY(-2px); box-shadow: var(--nh-shadow); }
.np-ic { width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.np-prod h3 { font-size: 16px; margin: 14px 0 6px; letter-spacing: -.2px; }
.np-prod p { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.55; }

/* ── ความปลอดภัย ── */
.np-trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.np-trust div { padding: 18px; border-radius: 14px; border: 1px solid var(--b1); background: var(--np-card); }
.np-trust svg { width: 22px; height: 22px; color: var(--nh-accent-tx); }
.np-trust strong { display: block; margin: 10px 0 4px; font-size: 15px; }
.np-trust span { font-size: 13.5px; color: var(--muted); }

/* ── ปิดท้าย ── */
.np-final { margin: 0 0 72px; border-radius: 22px; padding: 44px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
    background: linear-gradient(120deg, #2A2470 0%, #534AB7 55%, #3D7FC4 100%); color: #fff; box-shadow: 0 20px 50px rgba(83,74,183,.35); }
.np-final h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.4px; }
.np-final p { margin: 0; opacity: .85; }
.np-final .np-btn-ghost { color: #fff !important; border-color: rgba(255,255,255,.45); }
.np-final .np-btn-ghost:hover { background: rgba(255,255,255,.1); }
.np-final .np-btn-primary { background: #fff; color: #2A2470 !important; box-shadow: none; }
.np-final .np-btn-primary:hover { background: #F1F0FF; }

.np-foot { border-top: 1px solid var(--b1); padding: 22px 0 30px; font-size: 13px; color: var(--muted); }
.np-foot .np-wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.np-foot a { color: var(--muted); }
.np-foot a:hover { color: var(--tx); }
.np-foot .np-admin { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }

/* ═══ หน้าเข้าสู่ระบบ (Hub / ผู้ดูแลแพลตฟอร์ม) ═══ */
.np-auth { height: 100vh; overflow-y: auto; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; background: var(--bg); color: var(--tx); font-family: var(--font); }
.np-auth-brand { position: relative; overflow: hidden; color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    background: radial-gradient(70% 60% at 85% 10%, rgba(123,114,224,.55) 0%, rgba(123,114,224,0) 70%), linear-gradient(150deg, #1D1854 0%, #3A3290 55%, #2E5FA0 100%); }
.np-auth--admin .np-auth-brand { background: radial-gradient(60% 50% at 90% 0%, rgba(99,102,241,.35) 0%, rgba(99,102,241,0) 70%), linear-gradient(160deg, #0B0D14 0%, #151826 60%, #1B2033 100%); }
.np-auth-brand::after { content: ""; position: absolute; inset: auto -80px -120px auto; width: 360px; height: 360px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.02); pointer-events: none; }
.np-auth-brand a { color: #fff; text-decoration: none; }
.np-auth-brand .np-brand { color: #fff; }
.np-auth-brand .np-brand small { color: rgba(255,255,255,.7); }
.np-auth-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); }
.np-auth-h { font-size: clamp(26px, 2.6vw, 36px); line-height: 1.22; font-weight: 800; letter-spacing: -.6px; margin: 16px 0 12px; }
.np-auth-p { color: rgba(255,255,255,.78); margin: 0 0 22px; max-width: 440px; }
.np-auth-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.np-auth-list li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255,255,255,.88); font-size: 14.5px; }
.np-auth-list li::before { content: "✓"; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.14); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.np-auth-dots { display: flex; gap: 8px; flex-wrap: wrap; }
.np-auth-dots span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.85); }
.np-auth-legal { font-size: 12px; color: rgba(255,255,255,.55); }

.np-auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.np-auth-card { width: 100%; max-width: 400px; }
.np-auth-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin: 0 0 6px; }
.np-auth-card .np-auth-intro { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.np-auth-card .field-label { display: block; font-size: 13px; font-weight: 600; color: var(--tx); margin-bottom: 6px; }
.np-auth-card .field-input { width: 100%; height: 46px; background: var(--surface); border: 1px solid var(--b2); border-radius: 10px; padding: 0 14px; color: var(--tx); font-family: var(--font); font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s; box-sizing: border-box; }
.np-auth-card .field-input:focus { border-color: var(--np-brand-2); box-shadow: 0 0 0 4px rgba(123,114,224,.18); }
.np-auth-card .np-submit { width: 100%; margin-top: 22px; height: 48px; font-size: 16px; }
.np-auth-card .np-row { display: flex; justify-content: space-between; align-items: baseline; }
.np-auth-card .np-row a { font-size: 13px; color: var(--nh-accent-tx); text-decoration: none; }
.np-auth-foot { width: 100%; max-width: 400px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--b1); font-size: 13.5px; color: var(--muted); display: grid; gap: 8px; }
.np-auth-foot a { color: var(--nh-accent-tx); text-decoration: none; font-weight: 600; }
.np-auth-foot a:hover, .np-auth-card .np-row a:hover { text-decoration: underline; }
.np-auth-notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--nh-warn-bg); border: 1px solid var(--nh-warn-line); color: var(--tx); font-size: 13px; margin-bottom: 20px; }
.np-auth-notice b { color: var(--nh-warn-tx); }

/* ── จอเล็ก ── */
@media (max-width: 980px) {
    .np-hero .np-wrap { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; padding-bottom: 56px; }
    .np-grid, .np-trust { grid-template-columns: repeat(2, 1fr); }
    .np-nav { display: none; }
    .np-auth { grid-template-columns: 1fr; }
    .np-auth-brand { padding: 24px; gap: 16px; }
    .np-auth-brand .np-auth-hide-sm { display: none; }
}
@media (max-width: 560px) {
    .np-wrap { padding: 0 16px; }
    .np-grid, .np-trust { grid-template-columns: 1fr; }
    .np-top-actions .np-btn-ghost { display: none; }
    .np-final { padding: 28px; }
    .np-foot .np-admin { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .np-btn, .np-prod { transition: none; } .np-btn-primary:hover, .np-prod:hover { transform: none; } }
