/* ==========================================================================
   M-Tech Expert Solutions — LAT platform
   style.css  : design tokens, base, layout and shared components (mobile-first)
   responsive.css : larger-screen enhancements
   app.css    : test runner, results, dashboard and admin (loaded only on app pages)
   System fonts only: no web-font download, no layout shift.
   ========================================================================== */
:root {
  --ink: #14213d;
  --text: #273043;
  --muted: #566072;
  --bg: #ffffff;
  --soft: #f3f7f5;
  --line: #dbe3df;
  --brand: #0e5a47;
  --brand-dark: #0a4335;
  --brand-soft: #e4f1ec;
  --accent: #f2a900;
  --accent-dark: #d99700;
  --ok: #17703f;
  --ok-soft: #e3f4ea;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --warn: #7a5200;
  --warn-soft: #fff4d6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 4px 14px rgba(20, 33, 61, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ur: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Mehr Nastaliq Web", "Urdu Typesetting", "Noto Naskh Arabic", serif;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 1rem/1.65 var(--font); color: var(--text); background: var(--bg); }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: 1.85rem; letter-spacing: -.01em; }
h2 { font-size: 1.4rem; margin-top: 1.8em; }
h3 { font-size: 1.12rem; margin-top: 1.4em; }
p, ul, ol, dl, table, blockquote { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: .35em; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
strong { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6em 1em; z-index: 100; }
.skip:focus { left: 0; }

.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }
.section { padding: 2.4rem 0; }
.section-soft { background: var(--soft); }
.section > .container > h2:first-child, .section h2.section-title { margin-top: 0; }
.lead { font-size: 1.1rem; color: var(--muted); }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: .5em; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 50; }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55em; text-decoration: none; color: var(--ink); font-size: 1rem; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 800; }
.brand-text strong { color: var(--brand); }
.nav-toggle { width: 44px; height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after { display: block; width: 20px; height: 2px; background: var(--ink); position: relative; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -6px; } .nav-toggle-bar::after { top: 6px; }
.site-nav { display: none; width: 100%; padding: .5rem 0 1rem; }
.site-nav.open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav li a { display: block; padding: .7em .2em; text-decoration: none; color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--line); }
.site-nav li a[aria-current] { color: var(--brand); }
.nav-actions { display: flex; gap: .8em; align-items: center; padding-top: .9rem; flex-wrap: wrap; }
.nav-account { font-weight: 600; text-decoration: none; padding: .5em .2em; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 46px; padding: .6em 1.2em; border-radius: 8px; border: 2px solid transparent; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center; }
.btn-sm { min-height: 40px; padding: .4em .9em; font-size: .95rem; }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--accent-dark); color: var(--ink); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-ghost-light:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row, .cta-row { display: flex; flex-wrap: wrap; gap: .7em; margin-bottom: 0; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { padding-top: .8rem; font-size: .88rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3em; margin: 0; padding: 0; color: var(--muted); }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: .3em; color: var(--muted); }

/* ---------- Page head / hero ---------- */
.page-head { padding: 1.6rem 0 .4rem; }
.page-head h1 { margin-bottom: .4em; }
.hero { background: linear-gradient(160deg, var(--brand-dark), var(--brand)); color: #e9f4f0; padding: 2.6rem 0; }
.hero h1 { color: #fff; font-size: 2rem; }
.hero .lead { color: #d5e9e2; }
.hero .eyebrow { color: #ffd76a; }
.hero-points { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .5em; font-size: .95rem; }
.hero-points li::before { content: "✓"; color: #ffd76a; font-weight: 700; margin-right: .5em; }
.hero-card { background: #fff; color: var(--text); border-radius: var(--radius); padding: 1.2rem; margin-top: 1.6rem; box-shadow: var(--shadow); }
.hero-card h2 { font-size: 1.05rem; margin: 0 0 .6em; }
.hero-card table { margin: 0; }

/* ---------- Cards / grids ---------- */
.card-grid { list-style: none; padding: 0; margin: 0 0 1.2em; display: grid; gap: 14px; grid-template-columns: 1fr; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin: 0; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 .4em; font-size: 1.08rem; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card p { margin-bottom: .5em; font-size: .96rem; }
.card-meta { color: var(--muted); font-size: .85rem; margin: 0; }
.pill { display: inline-block; padding: .15em .7em; border-radius: 99px; background: var(--brand-soft); color: var(--brand-dark); font-size: .8rem; font-weight: 700; }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-muted { background: #eceff3; color: var(--muted); }

/* ---------- Prose ---------- */
.prose { padding-top: .6rem; padding-bottom: 2.4rem; }
.prose > h2:first-child { margin-top: .6em; }
.prose h2 { scroll-margin-top: 80px; }
.prose h3 { scroll-margin-top: 80px; }
.toc { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1.4em; }
.toc h2 { font-size: 1rem; margin: 0 0 .5em; }
.toc ol { margin: 0; columns: 1; }
.toc li { font-size: .95rem; }
.answer-box { border-left: 4px solid var(--brand); background: var(--brand-soft); padding: .9rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 1.3em; }
.answer-box p:last-child { margin-bottom: 0; }

.notice { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1.3em; background: #fff; font-size: .95rem; }
.notice p:last-child { margin-bottom: 0; }
.notice-official { border-color: #b9d6cb; background: #f2f9f6; }
.notice-warn { border-color: #ecd28a; background: var(--warn-soft); }
.notice-service { border-color: #c9d2e6; background: #f4f6fb; }
.notice-ok { border-color: #a9d8ba; background: var(--ok-soft); }
.notice-bad { border-color: #efb1ab; background: var(--bad-soft); }

.steps { list-style: none; counter-reset: step; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 1em 3rem; margin: 0; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; }
.steps > li > strong:first-child { display: block; }

.table-wrap { overflow-x: auto; margin-bottom: 1.2em; border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap table { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
caption { text-align: left; font-weight: 700; color: var(--ink); padding: .6em .8em; }
th, td { text-align: left; padding: .6em .8em; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--soft); color: var(--ink); white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th, tfoot td, tfoot th { border-bottom: 0; }
tfoot td, tfoot th { background: var(--soft); font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- FAQ ---------- */
.faq details { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .6em; background: #fff; }
.faq summary { cursor: pointer; padding: .85em 1em; font-weight: 700; color: var(--ink); list-style-position: outside; }
.faq summary:hover { background: var(--soft); }
.faq-a { padding: 0 1em .3em; }

/* ---------- Pricing ---------- */
.price-grid { display: grid; gap: 16px; grid-template-columns: 1fr; list-style: none; padding: 0; }
.price-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; margin: 0; }
.price-card h3 { margin-top: 0; }
.price { font-size: 1.7rem; font-weight: 800; color: var(--ink); margin-bottom: .2em; }
.price small { font-size: .85rem; font-weight: 600; color: var(--muted); }
.price-card ul { font-size: .95rem; flex: 1; }
.price-card.featured { border: 2px solid var(--brand); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--ink); color: #dfe6f3; padding: 2.2rem 0; }
.cta-band h2 { color: #fff; margin-top: 0; }
.cta-band a:not(.btn) { color: #ffd76a; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1rem; }
.field label, .field legend { display: block; font-weight: 700; color: var(--ink); margin-bottom: .3em; padding: 0; }
.field .hint { display: block; font-size: .85rem; color: var(--muted); font-weight: 400; }
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="url"], input[type="search"], input[type="file"], select, textarea {
  width: 100%; min-height: 46px; padding: .55em .7em; border: 1px solid #aab4c3; border-radius: 8px; font: inherit; color: var(--ink); background: #fff;
}
textarea { min-height: 8em; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--brand); }
.field-error { color: var(--bad); font-size: .9rem; font-weight: 600; margin-top: .3em; }
[aria-invalid="true"] { border-color: var(--bad) !important; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; background: #fff; box-shadow: var(--shadow); max-width: 480px; margin: 0 auto 2rem; }
.check { display: flex; gap: .6em; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin-top: .2em; flex: none; }

/* ---------- Article ---------- */
.article-meta { color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: .4em 1em; align-items: center; margin-bottom: .6em; }
.related { background: var(--soft); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1.6em 0; }
.related h2 { font-size: 1.05rem; margin: 0 0 .5em; }
.related ul { margin: 0; }
.inline-cta { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1.4em 0; background: #fff; }
.inline-cta p { margin-bottom: .7em; }
.save-btn { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: .3em .9em; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--brand); min-height: 36px; }
.save-btn[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); }

/* ---------- Welcome-back banner ---------- */
.welcome { background: var(--warn-soft); border-bottom: 1px solid #ecd28a; padding: .9rem 0; }
.welcome p { margin: 0 0 .5em; }
.welcome .btn-row { align-items: center; }

/* ---------- Urdu script ---------- */
.ur, [lang="ur"] { font-family: var(--font-ur); direction: rtl; text-align: right; line-height: 2.2; font-size: 1.12em; }

/* ---------- Footer ---------- */
.site-footer { background: #0c1a30; color: #c5cede; padding: 2.2rem 0 1.2rem; font-size: .93rem; }
.site-footer a { color: #e5ebf5; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.site-footer h2 { color: #fff; font-size: .95rem; margin: 0 0 .6em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45em; }
.footer-grid { display: grid; gap: 1.6rem; grid-template-columns: 1fr 1fr; }
.footer-about { grid-column: 1 / -1; }
.footer-brand { font-size: 1.05rem; color: #fff; margin-bottom: .3em; }
.footer-brand strong { color: #7fd1b6; }
.footer-note { border-top: 1px solid #24344f; margin-top: 1.6rem; padding-top: 1rem; font-size: .85rem; color: #aab6ca; }
.footer-note strong { color: #fff; }
.footer-note a { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
@media print { .site-header, .site-footer, .cta-band, .breadcrumb, .nav-toggle { display: none !important; } }
