/* वाहन डिझेल नोंदवही — government portal feel: tricolour strip, navy header, NMC emblem, large Marathi type. */
@font-face { font-family: "NotoDev"; src: url("/fonts/NotoSansDevanagari-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "NotoDev"; src: url("/fonts/NotoSansDevanagari-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --navy: #0b3d6e; --navy2: #0f4f8c; --sky: #e8f1fa; --saffron: #ff9933; --green: #138808; --ink: #1b2430; --muted: #5a6675;
  --line: #c9d6e3; --paper: #ffffff; --bg: #f3f6f9; --auto: #eef6ee; --auto-line: #b9d8b9; --result: #fff4e3; --red: #b3261e;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font: 19px/1.5 "NotoDev", "Noto Sans Devanagari", "Mangal", sans-serif; color: var(--ink); background: var(--bg) url("/img/nmc-watermark.png") no-repeat center 58% / min(78vw, 420px) auto; background-attachment: fixed; min-height: 100vh; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
.muted { color: var(--muted); } .small { font-size: 15px; }
.view { display: none; }
body[data-view="gate"] #gate, body[data-view="app"] #app { display: block; }

/* ---------------------------------------------------------------- header */
.tricolour { display: grid; grid-template-columns: 1fr 1fr 1fr; height: 6px; }
.tricolour i:nth-child(1) { background: var(--saffron); } .tricolour i:nth-child(2) { background: #fff; } .tricolour i:nth-child(3) { background: var(--green); }
.gov { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.gov .emblem { width: 56px; height: auto; flex: none; }
.gov-title { flex: 1; min-width: 0; }
.gov h1 { font-size: 23px; color: var(--navy); font-weight: 700; }
.gov p { margin: 0; font-size: 15px; color: #a14d00; font-weight: 700; }
.help-top { flex: none; border: 1.5px solid var(--navy); color: var(--navy); background: #fff; border-radius: 10px; padding: 6px 12px; font: 700 16px "NotoDev", sans-serif; }
.ribbon { background: linear-gradient(90deg, var(--navy), var(--navy2)); color: #fff; font-size: 15px; padding: 6px 14px; letter-spacing: 0.02em; }

/* ---------------------------------------------------------------- buttons + fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 18px; border-radius: 12px; border: 2px solid var(--navy); background: #fff; color: var(--navy); font: 700 18px "NotoDev", sans-serif; cursor: pointer; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy); color: #fff; box-shadow: 0 4px 0 #062645; }
.btn.primary:active { box-shadow: 0 1px 0 #062645; transform: translateY(3px); }
.btn.big { width: 100%; min-height: 62px; font-size: 21px; margin-top: 16px; }
.btn.ghost { flex: 1; }
.btn[disabled] { opacity: 0.6; }
.link { background: none; border: none; color: var(--navy2); font: 700 17px "NotoDev", sans-serif; padding: 14px; display: block; margin: 8px auto 0; text-decoration: underline; }
.link.danger { color: var(--red); }
.row-btns { display: flex; gap: 10px; margin-top: 12px; }
input[type="text"], input[type="password"] { font: 700 24px "NotoDev", sans-serif; color: var(--ink); width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; outline: none; text-align: right; }
input:focus { border-color: var(--navy2); box-shadow: 0 0 0 3px rgba(15, 79, 140, 0.18); }
.big-field { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; }
.big-field input { font-size: 32px; text-align: center; }
.big-field span { font-weight: 700; color: var(--muted); }
.lbl { display: block; font-size: 16px; color: var(--muted); margin: 8px 0; }
.lbl input { margin-top: 4px; text-align: left; letter-spacing: 0.3em; }

/* ---------------------------------------------------------------- gate */
#gate { padding: 18px 14px 30px; }
.panel { background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line); border-top: 5px solid var(--navy); border-radius: 14px; padding: 22px 18px; text-align: center; max-width: 460px; margin: 0 auto; box-shadow: 0 6px 20px -12px rgba(11, 61, 110, 0.45); }
.panel h2 { color: var(--navy); font-size: 26px; margin-bottom: 4px; }
.steps-mini { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.steps-mini span { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; color: var(--muted); font-size: 16px; }
.steps-mini span.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.steps-mini span.done { background: var(--green); border-color: var(--green); color: #fff; }
.dots { display: flex; gap: 18px; justify-content: center; margin: 18px 0; }
.dots i { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--navy); }
.dots i.f { background: var(--navy); }
.dots.shake { animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-9px); } 75% { transform: translateX(9px); } }
.pad { display: grid; grid-template-columns: repeat(3, 84px); gap: 12px 18px; justify-content: center; }
.pad button { width: 84px; height: 70px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); font: 700 30px "NotoDev", sans-serif; }
.pad button:active { background: var(--sky); border-color: var(--navy2); }
.pad .k-empty { visibility: hidden; }
.pad .k-del { font-size: 18px; color: var(--red); }
.msg { text-align: center; min-height: 1.6em; font-weight: 700; color: var(--navy); margin-top: 14px; }
.msg.err { color: var(--red); }

/* ---------------------------------------------------------------- app layout */
#app { padding: 12px 12px calc(96px + var(--safe-b)); max-width: 620px; margin: 0 auto; }
.screen { display: none; }
.screen.on { display: block; }
.sec-title { color: var(--navy); font-size: 25px; margin: 6px 4px 12px; border-left: 6px solid var(--saffron); padding-left: 10px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border-top: 3px solid var(--navy); padding-bottom: var(--safe-b); box-shadow: 0 -4px 16px -8px rgba(0, 0, 0, 0.25); }
.tabs button { background: none; border: none; font: 700 17px "NotoDev", sans-serif; color: var(--muted); padding: 8px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 0; }
.tabs button span { font-size: 24px; line-height: 1.2; }
.tabs button.on { color: var(--navy); background: var(--sky); box-shadow: inset 0 4px 0 var(--saffron); }

/* ---------------------------------------------------------------- month bar */
.month-bar { display: grid; grid-template-columns: 58px 1fr 58px; align-items: center; background: var(--navy); color: #fff; border-radius: 14px; padding: 6px; }
.mbtn { height: 54px; border-radius: 10px; border: none; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 36px; line-height: 1; }
.mbtn:active { background: rgba(255, 255, 255, 0.3); }
.mname { text-align: center; display: flex; flex-direction: column; }
.mlabel { font-size: 13px; opacity: 0.85; }
.mname b { font-size: 24px; }
.mstate { font-size: 15.5px; color: #ffe2bd; font-weight: 700; }
.mstate.dirty { align-self: center; margin-top: 2px; background: #ffd23f; color: #3a2a00; border-radius: 999px; padding: 1px 12px; }
.mstate.saved { color: #b8f5b8; }

/* ---------------------------------------------------------------- the slip */
.slip { background: rgba(255, 255, 255, 0.97); border: 1.5px solid var(--line); border-radius: 14px; margin-top: 12px; overflow: hidden; }
.slip-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--sky); border-bottom: 1.5px solid var(--line); }
.slip-head img { width: 34px; }
.slip-head div { display: flex; flex-direction: column; line-height: 1.25; }
.slip-head b { color: var(--navy); font-size: 17px; }
.slip-head span { font-size: 14px; color: var(--muted); }
.row { display: grid; grid-template-columns: 38px 1fr minmax(128px, 42%); align-items: center; gap: 4px 8px; padding: 10px 12px; border-bottom: 1px solid #e3e9ef; position: relative; }
.row .no { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.row label { font-weight: 700; font-size: 17px; line-height: 1.3; }
.row .val { display: flex; align-items: center; gap: 6px; }
.row .val em { font-style: normal; font-size: 15px; font-weight: 700; color: var(--muted); width: 44px; flex: none; line-height: 1.15; }
.row output { flex: 1; text-align: right; font-weight: 700; font-size: 25px; padding: 8px 10px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.row .hint { grid-column: 2 / 4; font-size: 15px; color: var(--green); font-weight: 700; margin-top: -2px; }
.row .hint:empty { display: none; }
.row .tag { position: absolute; top: 2px; right: 12px; font-size: 13px; font-weight: 700; color: var(--green); display: none; }
.row.auto { background: var(--auto); }
.row.auto output { background: #fff; border: 2px dashed var(--auto-line); color: #0d5c0d; }
.row.auto .tag { display: block; }
.row.auto .no, .row.computed .no { background: var(--green); }
.row.computed { background: var(--auto); }
.row.computed input { border-style: dashed; border-color: var(--auto-line); color: #0d5c0d; background: #fff; }
.row.computed .tag { display: block; }
.row.result { background: var(--result); border-bottom: none; padding: 14px 12px; }
.row.result .no { background: var(--saffron); }
.row.result .tag { display: block; color: #a14d00; }
.row.result .val { flex-direction: column; align-items: stretch; gap: 2px; }
.row.result .val em { width: auto; font-size: 15px; text-align: right; color: #a14d00; }
.row.result label { font-size: 19px; }
.row.result output { font-size: 36px; color: #a14d00; background: #fff; border: 2px solid #f3c58a; }
.row.bad input { border-color: var(--red); background: #fff5f4; }
.either { margin: 0; padding: 9px 14px; font-size: 16px; background: #fffbe6; color: #6b5300; border-bottom: 1px solid #f1e3a6; }
.err { color: var(--red); font-weight: 700; padding: 0 14px; margin: 0; }
.err:not(:empty) { padding: 10px 14px; background: #fff5f4; }

/* ---------------------------------------------------------------- history */
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.summary div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.summary b { display: block; font-size: 24px; color: var(--navy); }
.summary span { font-size: 14px; color: var(--muted); }
.hist { display: flex; flex-direction: column; gap: 10px; }
.hrow { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; background: #fff; border: 1.5px solid var(--line); border-left: 6px solid var(--navy); border-radius: 12px; padding: 12px 14px; text-align: left; font: inherit; color: inherit; width: 100%; }
.hrow b { font-size: 20px; color: var(--navy); }
.hrow .sub { font-size: 14.5px; color: var(--muted); grid-column: 1; }
.hrow .avg { grid-row: 1 / 3; grid-column: 2; text-align: right; }
.hrow .avg strong { display: block; font-size: 27px; color: #a14d00; line-height: 1.1; }
.hrow .avg small { font-size: 12.5px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---------------------------------------------------------------- help */
.card-btn { display: flex; flex-direction: column; width: 100%; text-align: left; background: #fff; border: 2px solid var(--navy); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; font: inherit; color: var(--ink); }
.card-btn b { color: var(--navy); font-size: 20px; }
.card-btn span { font-size: 15px; color: var(--muted); }
.card { background: rgba(255, 255, 255, 0.97); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.card h3 { color: var(--navy); font-size: 19px; }

/* ---------------------------------------------------------------- overlay: tutorial + home screen guide */
.ov-bg { position: fixed; inset: 0; z-index: 40; background: rgba(6, 25, 45, 0.6); }
.ov { position: fixed; left: 10px; right: 10px; top: 50%; transform: translateY(-50%); z-index: 41; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 16px; border-top: 6px solid var(--navy); padding: 16px 16px calc(16px + var(--safe-b)); max-width: 560px; margin: 0 auto; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6); }
.ov-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ov-head img { width: 38px; }
.ov-head div { flex: 1; }
.ov-head small { display: block; font-size: 13px; color: #a14d00; font-weight: 700; }
.ov-head h3 { color: var(--navy); font-size: 22px; }
.ov p { margin: 8px 0; }
.ov .say { font-size: 18px; }
.prog { display: flex; gap: 6px; justify-content: center; margin: 10px 0 4px; }
.prog i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.prog i.on { background: var(--navy); width: 26px; border-radius: 6px; }
.ov-nav { display: flex; gap: 10px; margin-top: 12px; }
.ov-nav .btn { flex: 1; }
.steps { list-style: none; margin: 8px 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 4px 0 12px 46px; font-size: 18px; line-height: 1.45; }
.steps li::before { content: counter(s, devanagari); position: absolute; left: 0; top: 2px; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; }
.steps b { color: var(--navy); }
.key { display: inline-block; border: 1.5px solid var(--navy); border-radius: 7px; padding: 0 7px; font-weight: 700; color: var(--navy); background: var(--sky); }
.note { background: #fffbe6; border: 1px solid #f1e3a6; border-radius: 10px; padding: 10px 12px; font-size: 15.5px; color: #5c4700; }

/* mini illustrations inside the tutorial */
.demo { border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; margin: 10px 0; font-size: 15px; }
.demo .d { display: grid; grid-template-columns: 26px 1fr 96px; gap: 6px; align-items: center; padding: 7px 10px; border-bottom: 1px solid #e6ecf2; }
.demo .d:last-child { border-bottom: none; }
.demo .n { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; display: grid; place-items: center; font-weight: 700; }
.demo .v { text-align: right; font-weight: 700; border: 1.5px solid var(--line); border-radius: 7px; padding: 1px 7px; background: #fff; }
.demo .d.a { background: var(--auto); }
.demo .d.a .n { background: var(--green); }
.demo .d.a .v { border-style: dashed; border-color: var(--auto-line); color: #0d5c0d; }
.demo .d.hl .v { border-color: var(--saffron); box-shadow: 0 0 0 3px rgba(255, 153, 51, 0.3); }
.demo .d.r { background: var(--result); }
.demo .d.r .n { background: var(--saffron); }
.demo .d.r .v { color: #a14d00; border-color: #f3c58a; font-size: 18px; }
.phone { border: 3px solid #2a3442; border-radius: 22px; padding: 10px; max-width: 250px; margin: 10px auto; background: #f7f9fb; position: relative; font-size: 14px; }
.phone .bar { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 4px 10px; }
.phone .bar span { flex: 1; color: var(--muted); font-size: 12.5px; overflow: hidden; white-space: nowrap; }
.phone .bar b { font-size: 18px; color: var(--navy); }
.phone .bar b.ring { border-radius: 6px; box-shadow: 0 0 0 3px var(--saffron); padding: 0 4px; }
.phone .menu { margin: 8px 0 0 auto; width: 76%; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.phone .menu div { padding: 6px 10px; border-bottom: 1px solid #edf1f5; color: var(--muted); }
.phone .menu div.pick { color: var(--navy); font-weight: 700; background: #fff4e3; box-shadow: inset 4px 0 0 var(--saffron); }
.phone .bottom { display: flex; justify-content: space-around; margin-top: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; font-size: 18px; color: var(--muted); }
.phone .bottom .ring { color: var(--navy); border-radius: 6px; box-shadow: 0 0 0 3px var(--saffron); padding: 0 5px; }
.phone .homeicons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 6px; }
.phone .homeicons i { aspect-ratio: 1; border-radius: 10px; background: #d9e2ec; }
.phone .homeicons figure { margin: 0; text-align: center; font-size: 10px; color: var(--ink); }
.phone .homeicons figure img { width: 100%; border-radius: 10px; box-shadow: 0 0 0 3px var(--saffron); }

/* ---------------------------------------------------------------- footer + toast */
.gov-foot { text-align: center; padding: 18px 14px calc(110px + var(--safe-b)); color: var(--muted); font-size: 14px; border-top: 4px solid var(--navy); background: #fff; margin-top: 24px; }
body[data-view="gate"] .gov-foot { padding-bottom: 24px; }
.gov-foot img { width: 44px; opacity: 0.9; }
.gov-foot p { margin: 4px 0; }
.gov-foot .fine { font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 60; background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 700; max-width: 92vw; text-align: center; transition: all 0.25s; pointer-events: none; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5); }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--red); }

@media (max-width: 370px) {
  .row { grid-template-columns: 32px 1fr minmax(112px, 44%); padding: 9px 9px; }
  .row label { font-size: 15.5px; }
  .pad { grid-template-columns: repeat(3, 74px); }
  .pad button { width: 74px; }
}

/* ---------------------------------------------------------------- print: an official-looking slip */
.print-only { display: none; }
@media print {
  @page { size: A5 portrait; margin: 12mm; }
  body { background: #fff; font-size: 13pt; }
  body > *:not(.print-only) { display: none !important; }
  .print-only { display: block !important; }
  .ps { border: 2px solid #000; padding: 8mm; position: relative; }
  .ps-head { display: flex; align-items: center; gap: 4mm; border-bottom: 2px solid #000; padding-bottom: 3mm; margin-bottom: 3mm; }
  .ps-head img { width: 18mm; }
  .ps-head h2 { font-size: 17pt; }
  .ps-head p { margin: 0; font-size: 11pt; }
  .ps-month { text-align: center; font-weight: 700; margin: 2mm 0 4mm; font-size: 14pt; }
  .ps table { width: 100%; border-collapse: collapse; }
  .ps td { border: 1px solid #000; padding: 2.2mm 3mm; }
  .ps td.n { width: 9mm; text-align: center; font-weight: 700; }
  .ps td.v { width: 32mm; text-align: right; font-weight: 700; }
  .ps tr.res td { background: #f3f3f3; font-size: 14pt; }
  .ps-wm { position: absolute; left: 50%; top: 55%; width: 70mm; transform: translate(-50%, -50%); opacity: 0.07; }
  .ps-foot { margin-top: 10mm; display: flex; justify-content: space-between; font-size: 11pt; }
}
