@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #315ee7;
    --primary-dark: #2448bd;
    --ink: #17243d;
    --muted: #6a7890;
    --surface: #ffffff;
    --canvas: #f4f7fc;
    --border: #e5eaf3;
    --radius: 18px;
    --shadow: 0 10px 35px rgba(30, 55, 95, .08);
}

* { box-sizing: border-box; }
body { min-height: 100vh; background: var(--canvas); color: var(--ink); font-family: 'Noto Sans Thai', system-ui, sans-serif; }
a { text-decoration: none; }
.app-navbar { background: rgba(255,255,255,.94); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(229,234,243,.8); }
.navbar-brand { display: flex; align-items: center; gap: .65rem; color: var(--ink); font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg,#315ee7,#7a5af8); border-radius: 13px; box-shadow: 0 7px 18px #315ee755; }
.navbar-nav { gap: .15rem; }
.navbar .nav-link { color: #5d6d86; font-size: .88rem; font-weight: 600; border-radius: 11px; padding: .65rem .7rem !important; }
.navbar .nav-link:hover,.navbar .nav-link.active { color: var(--primary); background: #edf2ff; }
.user-menu { border: 0; background: transparent; display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.user-menu small { display: block; color: var(--muted); font-size: .72rem; font-weight: 500; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #e9efff; color: var(--primary); font-weight: 800; }
.app-main { min-height: calc(100vh - 150px); padding-top: 2rem; padding-bottom: 3rem; }
.app-footer { padding: 1.4rem 0; color: var(--muted); background: #fff; border-top: 1px solid var(--border); font-size: .86rem; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.page-heading h1 { margin: 0; font-size: clamp(1.55rem,3vw,2rem); font-weight: 800; letter-spacing: -.03em; }
.page-heading p { margin: .35rem 0 0; color: var(--muted); }
.card-soft { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-soft .card-header { padding: 1.15rem 1.25rem; background: transparent; border-bottom: 1px solid var(--border); }
.card-soft .card-body { padding: 1.25rem; }
.card-title { font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; }
.stat-card { display: flex; align-items: center; gap: 1rem; padding: 1.15rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card small,.stat-card span { display: block; color: var(--muted); font-size: .78rem; }
.stat-card strong { display: block; margin: .05rem 0; font-size: 1.65rem; line-height: 1.25; }
.stat-icon { flex: 0 0 50px; width: 50px; height: 50px; display: grid !important; place-items: center; border-radius: 16px; font-size: 1.35rem !important; }
.stat-icon.blue { color:#315ee7;background:#edf2ff }.stat-icon.green{color:#078767;background:#e8fbf5}.stat-icon.orange{color:#cb6811;background:#fff2e7}.stat-icon.purple{color:#7346d8;background:#f2edff}.stat-icon.red{color:#cb3d56;background:#ffedf1}
.hero { position: relative; overflow: hidden; padding: clamp(2rem,6vw,5.5rem); background: linear-gradient(135deg,#162a59,#315ee7 55%,#7659ef); color: #fff; border-radius: 28px; box-shadow: 0 24px 65px #254bb836; }
.hero::before,.hero::after { content:''; position:absolute; border-radius:50%; background:#fff; opacity:.07; }.hero::before{width:340px;height:340px;right:-120px;top:-180px}.hero::after{width:240px;height:240px;right:20%;bottom:-180px}
.hero-content { position:relative; z-index:1; max-width: 720px; }.hero h1{font-size:clamp(2rem,5vw,4rem);font-weight:800;line-height:1.12;letter-spacing:-.04em}.hero p{font-size:1.1rem;opacity:.86;max-width:620px}.hero-badge{display:inline-flex;align-items:center;gap:.4rem;padding:.5rem .8rem;border:1px solid #ffffff40;background:#ffffff18;border-radius:999px;margin-bottom:1.2rem}
.feature-card { height:100%; padding:1.4rem; background:#fff; border:1px solid var(--border); border-radius:var(--radius); }.feature-card i{font-size:1.5rem;color:var(--primary)}.feature-card h3{font-size:1.05rem;font-weight:700;margin:.8rem 0 .35rem}.feature-card p{color:var(--muted);margin:0;font-size:.9rem}
.auth-shell { max-width: 980px; margin: 1rem auto; display:grid;grid-template-columns:1fr 1fr; overflow:hidden; border-radius:26px; background:#fff; box-shadow:0 24px 70px #1e3a5f17; border:1px solid var(--border) }.auth-art{padding:3rem;background:linear-gradient(145deg,#172b5b,#315ee7);color:#fff;display:flex;flex-direction:column;justify-content:center}.auth-art i{font-size:3rem}.auth-card{padding:clamp(1.5rem,5vw,3rem)}
.form-control,.form-select { min-height: 46px; border-radius: 12px; border-color: #dce3ee; }.form-control:focus,.form-select:focus{border-color:#91a9f8;box-shadow:0 0 0 .22rem #315ee71a}.form-label{font-weight:600;font-size:.9rem}.btn{border-radius:11px;font-weight:600;padding:.64rem 1rem}.btn-primary{background:var(--primary);border-color:var(--primary)}.btn-primary:hover{background:var(--primary-dark);border-color:var(--primary-dark)}
.table { --bs-table-bg: transparent; }.table thead th{color:var(--muted);font-size:.78rem;text-transform:uppercase;letter-spacing:.02em;border-bottom-width:1px}.table td{vertical-align:middle}.table-responsive{border-radius:0 0 var(--radius) var(--radius)}
.subject-card { position:relative; height:100%; overflow:hidden; padding:1.25rem; background:#fff; border:1px solid var(--border); border-radius:var(--radius); transition:.2s ease; }.subject-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}.subject-icon{width:48px;height:48px;display:grid;place-items:center;border-radius:15px;color:#fff;font-size:1.25rem}.subject-card h3{font-size:1.05rem;font-weight:700;margin:1rem 0 .25rem}.subject-card p{color:var(--muted);font-size:.86rem;min-height:42px}.subject-card .metric{display:flex;justify-content:space-between;padding-top:.9rem;border-top:1px solid var(--border);font-size:.85rem}
.wizard-steps { display:grid;grid-template-columns:repeat(3,1fr);gap:.75rem;margin-bottom:1.4rem }.wizard-step{display:flex;align-items:center;gap:.7rem;padding:.9rem;border:1px solid var(--border);border-radius:14px;background:#fff;color:var(--muted)}.wizard-step .num{width:30px;height:30px;display:grid;place-items:center;border-radius:50%;background:#edf0f5;font-weight:700}.wizard-step.active{border-color:#abc0ff;color:var(--primary);background:#f6f8ff}.wizard-step.active .num{background:var(--primary);color:#fff}
.choice-input { display:grid;grid-template-columns:44px 1fr;gap:.7rem;align-items:center }.choice-letter{width:42px;height:42px;display:grid;place-items:center;border-radius:12px;background:#edf2ff;color:var(--primary);font-weight:800}.question-card{padding:1.35rem;margin-bottom:1rem;background:#fff;border:1px solid var(--border);border-radius:var(--radius)}.question-number{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:11px;background:#edf2ff;color:var(--primary);font-weight:800}.question-text{font-size:1.05rem;font-weight:600;line-height:1.7}.question-image{max-height:320px;max-width:100%;border-radius:14px;border:1px solid var(--border)}
.answer-option{position:relative;display:flex;align-items:flex-start;gap:.8rem;padding:.9rem 1rem;margin:.55rem 0;border:1px solid var(--border);border-radius:13px;cursor:pointer;transition:.15s;background:#fff}.answer-option:hover{border-color:#aebfff;background:#f9faff}.answer-option:has(input:checked){border-color:var(--primary);background:#eef3ff;box-shadow:0 0 0 2px #315ee718}.answer-option input{margin-top:.3rem}.answer-label{display:grid;place-items:center;flex:0 0 30px;height:30px;border-radius:9px;background:#edf0f5;font-weight:700}.answer-option.correct{border-color:#8fd7bd;background:#edfbf5}.answer-option.wrong{border-color:#efadb9;background:#fff1f4}
.quiz-nav { position:sticky;top:88px }.question-dots{display:grid;grid-template-columns:repeat(5,1fr);gap:.45rem}.question-dot{display:grid;place-items:center;aspect-ratio:1;border-radius:9px;border:1px solid var(--border);color:var(--muted);font-weight:600;font-size:.82rem}.question-dot.answered{background:#eaf9f4;border-color:#a7ddca;color:#087b5f}.question-dot.current{background:var(--primary);color:#fff;border-color:var(--primary)}
.progress-thin{height:8px;border-radius:99px;background:#e8edf5}.progress-thin .progress-bar{border-radius:99px}.empty-state{text-align:center;max-width:600px;margin:5rem auto;padding:2rem}.empty-icon{width:84px;height:84px;display:grid;place-items:center;margin:0 auto 1rem;border-radius:24px;background:#edf2ff;color:var(--primary);font-size:2.2rem}.empty-state h1{font-size:1.6rem;font-weight:800}.empty-state p{color:var(--muted)}
.result-score{display:grid;place-items:center;width:170px;height:170px;margin:auto;border-radius:50%;background:conic-gradient(var(--primary) var(--score),#e9edf5 0);position:relative}.result-score::after{content:'';position:absolute;inset:13px;background:#fff;border-radius:50%}.result-score>div{position:relative;z-index:1;text-align:center}.result-score strong{display:block;font-size:2.2rem}.result-score small{color:var(--muted)}
.metric-bar{height:9px;background:#e8edf5;border-radius:99px;overflow:hidden}.metric-bar span{display:block;height:100%;background:var(--primary);border-radius:99px}.filter-bar{padding:1rem;background:#fff;border:1px solid var(--border);border-radius:15px;margin-bottom:1rem}.badge{font-weight:600;padding:.46em .65em}.alert{border:0;border-radius:14px}.pagination .page-link{border:0;margin:0 .15rem;border-radius:9px;color:var(--ink)}.pagination .active>.page-link{background:var(--primary)}
@media(max-width:1199px){.navbar .nav-link{padding:.55rem .52rem!important;font-size:.82rem}.stat-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:991px){.navbar-collapse{padding-bottom:1rem}.auth-shell{grid-template-columns:1fr}.auth-art{display:none}.quiz-nav{position:static}.wizard-steps{grid-template-columns:1fr}}
@media(max-width:575px){.app-main{padding-top:1.25rem}.page-heading{flex-direction:column}.page-heading .btn{width:100%}.stat-grid{grid-template-columns:1fr}.hero{border-radius:20px;padding:2rem 1.35rem}.hero h1{font-size:2rem}.question-card{padding:1rem}.choice-input{grid-template-columns:36px 1fr}.choice-letter{width:36px;height:36px}.auth-card{padding:1.25rem}.question-dots{grid-template-columns:repeat(10,1fr);gap:.25rem}.question-dot{border-radius:6px;font-size:.7rem}}
