/* Nepal Driving License — site styles (v3) */
:root {
  --brand: #0b5cad;
  --brand-dark: #08457f;
  --brand-soft: #e8f1fb;
  --red: #c81e0a;
  --orange: #f26a00;
  --green: #1b7e3c;
  --amber: #9a6700;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #17212b;
  --muted: #5b6673;
  --border: #dfe5ec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 48, 0.06), 0 4px 14px rgba(16, 32, 48, 0.06);
  --shadow-lg: 0 10px 30px rgba(16, 32, 48, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Noto Sans", "Noto Sans Devanagari", system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
body.lang-ne { font-family: "Noto Sans Devanagari", "Noto Sans", Arial, sans-serif; line-height: 1.75; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.3; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.small { font-size: 0.88rem; }
.muted { color: var(--muted); }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid #f2a900; outline-offset: 2px; }

/* ---------- Header & navigation ---------- */
.site-header { background: linear-gradient(110deg, var(--red), var(--orange)); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.header-row { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand img { background: #fff; border-radius: 9px; padding: 2px; }
.main-nav { margin-left: auto; }
.lang-switch {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: #fff; color: #1a1a1a; text-decoration: none;
  padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 0.92rem;
}
.lang-switch:hover { color: #000; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }

.menu-toggle > summary { list-style: none; cursor: pointer; display: none; }
.menu-toggle > summary::-webkit-details-marker, .sub > summary::-webkit-details-marker { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.nav-list > li > a, .sub > summary {
  display: block; color: #fff; text-decoration: none; font-weight: 600; padding: 10px 12px; border-radius: 8px; cursor: pointer; list-style: none; white-space: nowrap;
}
.nav-list > li > a:hover, .sub > summary:hover, .nav-list > li > a[aria-current="page"], .has-sub.active > .sub > summary { background: rgba(255,255,255,.18); color: #fff; }
.sub > summary::after { content: "▾"; font-size: .8em; margin-left: 5px; opacity: .85; }
.has-sub { position: relative; }
.sub > ul { list-style: none; margin: 0; padding: 8px; position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px; background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); }
.sub > ul a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--text); text-decoration: none; font-weight: 500; }
.sub > ul a:hover { background: var(--brand-soft); color: var(--brand-dark); }

@media (min-width: 981px) {
  .menu-toggle { display: contents; }
  .menu-toggle > .nav-list { display: flex !important; }
}
@media (max-width: 980px) {
  .header-row { flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; margin: 0; }
  .lang-switch { margin-left: auto; }
  .menu-toggle > summary { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; padding: 8px 0 12px; }
  .burger, .burger::before, .burger::after { display: block; width: 20px; height: 2px; background: #fff; position: relative; }
  .burger::before, .burger::after { content: ""; position: absolute; left: 0; }
  .burger::before { top: -6px; } .burger::after { top: 6px; }
  .nav-list { flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .sub > ul { position: static; box-shadow: none; background: rgba(255,255,255,.12); margin: 4px 0 6px; }
  .sub > ul a { color: #fff; }
  .sub > ul a:hover { background: rgba(255,255,255,.18); color: #fff; }
}

.breadcrumbs { font-size: .9rem; color: var(--muted); padding-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); }
main.wrap { padding-top: 22px; padding-bottom: 36px; }

/* ---------- Building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: #fff; text-decoration: none; border: 0;
  padding: 11px 20px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 1rem; font-family: inherit; line-height: 1.3;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn.secondary { background: #e9eef4; color: var(--text); }
.btn.secondary:hover { background: #dce4ed; color: var(--text); }
.btn.light { background: #fff; color: var(--brand-dark); }
.btn.success { background: var(--green); }
.btn.danger { background: #c62828; }
.btn.lg { padding: 14px 26px; font-size: 1.08rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 24px; }
.grid h2 { margin-top: 0; color: var(--brand); font-size: 1.2rem; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { background: var(--brand-soft); border: 1px solid #cfe2f6; margin: 8px 0; padding: 10px 12px; border-radius: 8px; }
.link-list a { font-weight: 600; text-decoration: none; }
.section { margin-top: 44px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.section-title h2 { margin: 0; font-size: clamp(1.3rem, 3vw, 1.7rem); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--red); }
.notice { background: #fff8e1; border: 1px solid #ffe08a; border-radius: 8px; padding: 12px 14px; margin: 14px 0; }
.notice.info { background: var(--brand-soft); border-color: #bcd7f3; }
.notice.danger { background: #fdecea; border-color: #f5c2bd; }
.badge { align-self: flex-start; display: inline-block; background: var(--brand-soft); color: var(--brand-dark); padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 4px 0 6px; font-size: clamp(1.6rem, 4vw, 2.3rem); }
.page-head p { margin: 0; color: var(--muted); font-size: 1.05rem; max-width: 760px; }
.two-col { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.toc { position: sticky; top: 84px; }
.toc ol, .toc ul { padding-left: 20px; margin: 8px 0 0; }
.toc li { margin: 4px 0; }
.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 18px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.stat strong { display: block; font-size: 1.7rem; color: var(--brand); line-height: 1.2; }
.stat span { color: var(--muted); font-size: .92rem; }
table.data { width: 100%; border-collapse: collapse; background: #fff; font-size: .97rem; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { background: #f0f4f8; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.prose { font-size: 1.05rem; }
.prose h2 { color: var(--brand); margin-top: 1.6em; font-size: 1.35rem; }
.prose h3 { margin-top: 1.3em; font-size: 1.12rem; }
.prose li { margin: 4px 0; }
details.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 16px; margin: 10px 0; }
details.faq-item > summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; }
details.faq-item > summary::after { content: "+"; float: right; font-weight: 400; font-size: 1.3em; line-height: 1; }
details.faq-item[open] > summary::after { content: "−"; }
details.faq-item > div { padding-bottom: 14px; color: var(--muted); }

/* ---------- Home ---------- */
.hero-main {
  background: radial-gradient(1200px 400px at 90% -10%, rgba(255,255,255,.18), transparent),
              linear-gradient(135deg, #0b5cad, #073b6e);
  color: #fff; border-radius: 18px; padding: clamp(26px, 5vw, 56px); display: grid; gap: 28px;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; box-shadow: var(--shadow-lg);
}
.hero-main h1 { font-size: clamp(1.8rem, 4.6vw, 2.9rem); margin: 6px 0 12px; }
.hero-main p { font-size: 1.1rem; opacity: .95; margin: 0 0 22px; }
.hero-main .eyebrow { color: #ffd27a; }
.hero-card { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); border-radius: 14px; padding: 18px; }
.hero-card ul { list-style: none; margin: 0; padding: 0; }
.hero-card li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; }
.hero-card li::before { content: "✓"; background: #2fbf71; color: #fff; border-radius: 50%; width: 22px; height: 22px; flex: none; display: grid; place-items: center; font-size: .8rem; margin-top: 2px; }
@media (max-width: 820px) { .hero-main { grid-template-columns: 1fr; } }

.feature-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.feature {
  display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--text); }
.feature .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; background: var(--brand-soft); }
.feature h3 { margin: 6px 0 0; font-size: 1.1rem; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }
.feature .go { margin-top: auto; color: var(--brand); font-weight: 700; font-size: .92rem; padding-top: 6px; }
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 18px 64px; position: relative; box-shadow: var(--shadow); }
.steps li::before { content: counter(step); position: absolute; left: 16px; top: 16px; width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; display: grid; place-items: center; }
.steps strong { display: block; margin-bottom: 4px; }

/* ---------- Blog ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.chip { padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: .92rem; font-weight: 600; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.post-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); margin-top: 18px; }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.post-card .cover { aspect-ratio: 2 / 1; background: linear-gradient(135deg, #0b5cad, #3a9be0); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2.2rem; text-decoration: none; }
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.post-card h3 { margin: 0; font-size: 1.1rem; line-height: 1.4; }
.post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h3 a:hover { color: var(--brand); }
.post-card p { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.meta { font-size: .85rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; gap: 12px; flex-wrap: wrap; }
.blog-head h1 { margin: 0; }
.blog-head p { margin: 4px 0 0; color: var(--muted); }
.article { max-width: 780px; margin: 0 auto; }
.article h1 { margin: 8px 0; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.article .cover-lg { border-radius: var(--radius); overflow: hidden; margin: 16px 0; }
.article .cover-lg img { width: 100%; display: block; }
.share { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; align-items: center; }

/* ---------- Quiz, mock test & question bank ---------- */
.quiz { max-width: 820px; margin: 0 auto; }
.q-text { font-size: 1.18rem; font-family: "Noto Sans Devanagari", sans-serif; margin: 0 0 14px; font-weight: 600; }
.q-img { height: 120px; width: auto; display: block; margin: 6px 0 12px; }
.option {
  display: block; width: 100%; text-align: left; font: inherit; font-family: "Noto Sans Devanagari", sans-serif; background: #fff;
  padding: 12px 16px; margin: 8px 0; border: 1.5px solid #c6d4e3; border-radius: 10px; cursor: pointer; transition: background .2s, border-color .2s;
}
.option:hover { border-color: var(--brand); background: #f6faff; }
.option.correct { background: #e6f6ec; border-color: #36a35d; }
.option.wrong { background: #fdecea; border-color: #e07a70; }
.option.selected { border-color: var(--brand); background: var(--brand-soft); }
.quiz-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 700; margin-bottom: 14px; }
.progress { height: 8px; background: #e6ecf2; border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #3a9be0); width: 0; transition: width .3s; }
.timer { font-variant-numeric: tabular-nums; }
.timer.low { color: #c62828; }
.qb-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0; }
.qb-item h3 { margin: 0 0 8px; font-size: 1.05rem; font-family: "Noto Sans Devanagari", sans-serif; }
.qb-item ol { margin: 0; padding-left: 22px; font-family: "Noto Sans Devanagari", sans-serif; }
.qb-item details { margin-top: 8px; }
.qb-item summary { cursor: pointer; color: var(--brand); font-weight: 700; }
.answer { color: var(--green); font-weight: 700; }
.result-big { font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 800; margin: 6px 0; }
.result-pass { color: var(--green); } .result-fail { color: #c62828; }

/* ---------- Eye test ---------- */
.eye-stage { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); min-height: 260px; display: grid; place-items: center; padding: 20px; }
.tumbling-e { font-family: Arial, sans-serif; font-weight: 700; line-height: 1; display: inline-block; color: #000; }
.dir-pad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 64px); gap: 8px; justify-content: center; margin-top: 16px; }
.dir-pad button { font-size: 1.6rem; border-radius: 12px; border: 1.5px solid #c6d4e3; background: #fff; cursor: pointer; }
.dir-pad button:hover { border-color: var(--brand); background: var(--brand-soft); }
.dir-pad .up { grid-column: 2; grid-row: 1; } .dir-pad .left { grid-column: 1; grid-row: 2; }
.dir-pad .right { grid-column: 3; grid-row: 2; } .dir-pad .down { grid-column: 2; grid-row: 3; }
.calib-card { width: 100%; max-width: 100%; aspect-ratio: 85.6 / 53.98; border: 2px dashed var(--brand); border-radius: 10px; background: repeating-linear-gradient(45deg, #f2f7fd, #f2f7fd 10px, #e6effa 10px, #e6effa 20px); display: grid; place-items: center; color: var(--brand-dark); font-weight: 700; }
input[type=range] { width: 100%; }
.plate-canvas { width: min(320px, 80vw); height: auto; border-radius: 50%; display: block; margin: 0 auto; }
.num-pad { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.num-pad button { min-width: 56px; padding: 10px 14px; font-size: 1.1rem; border-radius: 10px; border: 1.5px solid #c6d4e3; background: #fff; cursor: pointer; font-family: inherit; }
.num-pad button:hover { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- Trial ---------- */
.stage-list { display: grid; gap: 14px; }
.stage { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--brand); border-radius: 10px; padding: 16px 18px; box-shadow: var(--shadow); }
.stage h3 { margin: 0 0 6px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stage .marks { background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; padding: 2px 12px; font-size: .9rem; white-space: nowrap; }
.stage .fail { color: #c62828; font-weight: 600; }
.center-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.center { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.center h3 { margin: 0; font-size: 1.08rem; }
.center .where { color: var(--muted); font-size: .95rem; }
.center .actions { margin-top: auto; padding-top: 8px; }
.diagram { width: 100%; max-width: 520px; height: auto; display: block; margin: 8px auto; }

/* ---------- Ads ---------- */
.ad-slot { margin: 26px 0; text-align: center; min-height: 100px; }
.ad-label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #8a96a3; margin-bottom: 4px; }

/* ---------- Admin ---------- */
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
table.admin { width: 100%; border-collapse: collapse; background: #fff; }
table.admin th, table.admin td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; font-size: .95rem; }
table.admin th { background: #f0f3f7; white-space: nowrap; }
.status-published { color: var(--green); font-weight: 700; }
.status-draft { color: var(--amber); font-weight: 700; }
.form-grid { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field label { font-weight: 600; }
.field input[type=text], .field input[type=password], .field input[type=datetime-local], .field select, .field textarea {
  font: inherit; padding: 9px 10px; border: 1px solid #c5ced8; border-radius: 6px; background: #fff; width: 100%;
}
.field textarea { min-height: 120px; resize: vertical; }
.field textarea.body { min-height: 360px; }
.help { font-size: .85rem; color: var(--muted); }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.flash.ok { background: #e7f6ec; border: 1px solid #b7e1c4; }
.flash.err { background: #fdecea; border: 1px solid #f5c2bd; }
.inline-form { display: inline; }
.link-btn { background: none; border: 0; padding: 0; color: #c62828; cursor: pointer; font: inherit; text-decoration: underline; }

/* ---------- Footer ---------- */
.app-cta { background: linear-gradient(110deg, var(--red), var(--orange)); color: #fff; margin-top: 40px; }
.app-cta-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 26px; padding-bottom: 26px; flex-wrap: wrap; }
.app-cta h2 { margin: 0 0 4px; font-size: 1.35rem; }
.app-cta p { margin: 0; opacity: .95; }
.site-footer { background: #121a23; color: #b9c3cd; padding: 36px 0 0; font-size: .94rem; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1.4fr 1fr 1fr 1fr; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h3 { color: #fff; font-size: 1rem; margin: 0 0 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: #dbe3ea; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 800; font-size: 1.05rem; margin-top: 0; }
.footer-brand img { background: #fff; border-radius: 7px; padding: 2px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid #263240; margin-top: 26px; padding-top: 16px; padding-bottom: 20px; }

@media print {
  .site-header, .site-footer, .app-cta, .ad-slot, .breadcrumbs, .share, .lang-switch { display: none !important; }
  body { background: #fff; }
  .card, .qb-item, .stage { box-shadow: none; }
  .qb-item details > *:not(summary) { display: block !important; }
}
