/* M. Tech Solutions: light paper page, one deep-green terminal as the centrepiece.
   System fonts only, so no third-party font requests. */

:root {
  --paper: #F1F4EF;
  --band: #E4EBE2;
  --card: #FFFFFF;
  --ink: #0F2420;
  --muted: #4A625C;
  --line: #C6D3CA;
  --green: #0E5A48;
  --green-d: #0A4537;
  --deep: #0A2622;
  --red: #D92F35;
  --mint: #9FE0C0;
  --term-text: #D6EEE2;
  --term-dim: #86AC9C;

  --display: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(18px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img, svg { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-d); }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
.sr-copy { position: absolute; left: -9999px; top: 0; }
.noscript { padding: 16px var(--gutter); background: #fff3cd; }

/* Announcement banner (set from the admin panel) */
.announce { background: var(--green); color: #fff; text-align: center; padding: 10px var(--gutter); font-size: 0.95rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(241, 244, 239, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.mark { display: inline-grid; place-items: center; width: 26px; height: 26px; background: var(--green); border-radius: 7px; }
.mark i { width: 11px; height: 11px; background: var(--red); border-radius: 50%; transform: translateX(-1px); }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.97rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--red); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; background: var(--green); color: #fff; border: 2px solid var(--green); border-radius: 10px; font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.btn:hover { background: var(--green-d); border-color: var(--green-d); color: #fff; }
.btn-ghost { background: transparent; color: var(--green); }
.btn-ghost:hover { background: var(--green); color: #fff; border-color: var(--green); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 0.95rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.link-btn { background: none; border: 0; padding: 8px 4px; color: var(--green); font: 600 0.97rem var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--green-d); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 5vw, 64px); align-items: center; padding-block: clamp(36px, 7vw, 88px); }
.hero h1 { font-size: clamp(2.25rem, 4.8vw, 3.9rem); line-height: 1.04; letter-spacing: -0.025em; }
.lead { margin-top: 20px; font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { margin-top: 22px; color: var(--muted); font-size: 0.95rem; max-width: 34em; }

/* Terminal: the one memorable thing on the page */
.term { background: var(--deep); color: var(--term-text); border-radius: 16px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(10, 38, 34, 0.55); display: flex; flex-direction: column; min-height: 430px; max-height: 520px; }
.term-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid rgba(159, 224, 192, 0.16); font-family: var(--mono); font-size: 0.82rem; }
.term-title { color: var(--mint); }
.term-title::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: var(--red); }
.term-hint { color: var(--term-dim); }
.term-out { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 8px; font-family: var(--mono); font-size: 0.9rem; line-height: 1.55; scrollbar-color: #2C5A4D transparent; }
.term-out:focus-visible { outline-color: var(--mint); outline-offset: -3px; }
.tl { white-space: pre-wrap; overflow-wrap: anywhere; }
.tl-dim { color: var(--term-dim); }
.tl-err { color: #FF8F8F; }
.tl-head { color: var(--mint); margin-top: 6px; }
.tl-cmd .tp { color: var(--mint); margin-right: 8px; }
.tl-gap { height: 8px; }
.caret::after { content: "\2588"; margin-left: 2px; color: var(--mint); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.term-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 18px 12px; }
.chip { background: transparent; color: var(--mint); border: 1px solid rgba(159, 224, 192, 0.4); border-radius: 999px; padding: 5px 13px; font: 0.85rem var(--mono); cursor: pointer; }
.chip:hover { background: rgba(159, 224, 192, 0.14); }
.chip:focus-visible { outline-color: var(--mint); }

.term-form { display: flex; align-items: center; gap: 10px; padding: 12px 18px 14px; border-top: 1px solid rgba(159, 224, 192, 0.16); font-family: var(--mono); }
.term-prompt { color: var(--mint); font-size: 0.9rem; white-space: nowrap; }
.term-form input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--term-text); font: 16px var(--mono); padding: 4px 0; }
.term-form input::placeholder { color: #5E8676; }
.term-form input:focus-visible { outline: 0; }
.term-form:focus-within { box-shadow: inset 0 2px 0 var(--mint); }

/* Sections */
.section { padding-block: clamp(48px, 8vw, 96px); }
.band { background: var(--band); }
.section-head { max-width: 40em; margin-bottom: 28px; }
.section-head h2, .process h2, .contact h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
.section-head p { margin-top: 12px; color: var(--muted); }

/* Price sheet */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tab { background: transparent; color: var(--ink); border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 16px; font: 600 0.95rem var(--sans); cursor: pointer; }
.tab:hover { border-color: var(--green); }
.tab[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.sheet-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(24px, 4vw, 48px); align-items: start; }
.cat { font-size: 1.35rem; margin: 30px 0 4px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.cat:first-child { margin-top: 0; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 24px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.row h4 { font-family: var(--sans); font-size: 1.08rem; font-weight: 650; letter-spacing: 0; }
.row .scope { margin-top: 4px; color: var(--muted); font-size: 0.97rem; max-width: 46em; }
.price { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price strong { display: block; font-size: 1.05rem; }
.price span { color: var(--muted); font-size: 0.88rem; }
.add { min-width: 132px; min-height: 40px; background: transparent; color: var(--green); border: 2px solid var(--green); border-radius: 9px; font: 600 0.94rem var(--sans); cursor: pointer; }
.add:hover { background: rgba(14, 90, 72, 0.08); }
.add[aria-pressed="true"] { background: var(--green); color: #fff; }
.empty { color: var(--muted); padding: 24px 0; }

/* Estimate slip */
.slip { position: sticky; top: 88px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.slip h3 { font-size: 1.3rem; }
.slip .empty { padding: 12px 0 0; font-size: 0.97rem; }
.slip-list { list-style: none; margin: 16px 0 0; padding: 0; }
.slip-item { padding: 12px 0; border-top: 1px dashed var(--line); }
.slip-item .n { font-weight: 650; font-size: 0.97rem; line-height: 1.35; }
.slip-item .r { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-variant-numeric: tabular-nums; font-size: 0.92rem; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: 600 1rem var(--sans); cursor: pointer; line-height: 1; }
.stepper button:hover { border-color: var(--green); }
.stepper output { min-width: 28px; text-align: center; color: var(--ink); font-weight: 600; }
.stepper .u { margin-left: 4px; font-size: 0.85rem; }
.slip-total { margin-top: 6px; padding-top: 16px; border-top: 2px solid var(--ink); }
.slip-total .l { font-size: 0.92rem; color: var(--muted); }
.slip-total .v { font-family: var(--display); font-size: 1.55rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; margin-top: 2px; }
.slip-fine { margin-top: 10px; font-size: 0.85rem; color: var(--muted); }
.slip-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; align-items: stretch; }
.slip-actions .link-btn { align-self: center; }

/* Process */
.process { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(28px, 6vw, 80px); align-items: start; }
.steps { list-style: none; counter-reset: s; margin: 28px 0 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 26px 54px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font: 600 0.95rem var(--sans); }
.steps li::after { content: ""; position: absolute; left: 16px; top: 36px; bottom: 4px; width: 2px; background: var(--line); }
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps h3 { font-family: var(--sans); font-size: 1.12rem; font-weight: 650; letter-spacing: 0; }
.steps p { margin-top: 4px; color: var(--muted); max-width: 32em; }
.pay { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.pay h3 { font-size: 1.3rem; }
.pay p { margin-top: 10px; color: var(--muted); }
.pay dl { margin: 14px 0 0; }
.pay dt { font-weight: 650; margin-top: 14px; }
.pay dd { margin: 2px 0 0; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 6vw, 80px); align-items: start; }
.contact-info > p { margin-top: 14px; color: var(--muted); max-width: 30em; }
.contact-links { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; align-items: flex-start; }
.email-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.email-line a { font-size: 1.15rem; font-weight: 650; overflow-wrap: anywhere; }
.est-note { margin-top: 22px; padding: 12px 14px; border-left: 4px solid var(--red); background: var(--card); border-radius: 0 8px 8px 0; font-size: 0.95rem; }
.est-note:empty { display: none; }

.form { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: clamp(18px, 3vw, 30px); display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 650; font-size: 0.95rem; }
.field .hint { font-size: 0.87rem; color: var(--muted); }
input, select, textarea { width: 100%; font: 16px var(--sans); color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 9px; padding: 11px 12px; }
textarea { resize: vertical; min-height: 110px; }
input:hover, select:hover, textarea:hover { border-color: #93AA9F; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(217, 47, 53, 0.35); outline-offset: 0; border-color: var(--red); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--green); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-note { font-size: 0.93rem; min-height: 1.4em; color: var(--muted); }
.form-note.error { color: #B3232A; font-weight: 600; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Footer + visitor counter */
.site-footer { background: var(--deep); color: var(--term-text); padding-block: 40px; }
.foot { display: grid; grid-template-columns: 1fr auto 1fr; gap: 28px; align-items: center; }
.brand-foot { color: #fff; }
.foot-brand p { margin-top: 8px; color: var(--term-dim); font-size: 0.95rem; overflow-wrap: anywhere; }
.foot-brand a { color: var(--mint); }
.foot-meta { display: flex; gap: 18px; justify-content: flex-end; color: var(--term-dim); font-size: 0.92rem; }
.foot-meta a { color: var(--term-dim); }
.foot-meta a:hover { color: #fff; }
.counter { display: grid; justify-items: center; gap: 8px; }
.counter-label { color: var(--term-dim); font-size: 0.9rem; }
.counter-note { color: var(--term-dim); font-size: 0.8rem; min-height: 1em; }
.odo { display: inline-flex; gap: 4px; font: 600 1.6rem var(--mono); }
.odo-d { width: 0.86em; height: 1.35em; overflow: hidden; background: #0F3A32; border: 1px solid rgba(159, 224, 192, 0.25); border-radius: 6px; color: var(--mint); }
.odo-strip { display: flex; flex-direction: column; transform: translateY(calc(var(--d, 0) * -1.35em)); transition: transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.odo-strip span { display: block; height: 1.35em; line-height: 1.35em; text-align: center; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 24px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 0.95rem; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 200; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Admin dialog */
dialog#admin { width: min(1000px, 100% - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4); }
dialog#admin[open] { display: flex; flex-direction: column; }
dialog#admin::backdrop { background: rgba(10, 38, 34, 0.65); }
.ad-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 16px 22px; border-bottom: 1px solid var(--line); background: var(--card); }
.ad-top h2 { font-size: 1.35rem; margin-right: auto; }
.ad-badge { font-size: 0.85rem; padding: 4px 10px; border-radius: 999px; background: var(--band); color: var(--ink); }
.ad-badge.warn { background: #FFE9B8; }
.ad-status { font-size: 0.9rem; color: var(--muted); }
.ad-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 22px 0; border-bottom: 1px solid var(--line); }
.ad-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: 600 0.97rem var(--sans); color: var(--muted); cursor: pointer; }
.ad-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); }
.ad-body { min-height: 0; overflow-y: auto; padding: 24px 22px 32px; display: grid; gap: 20px; align-content: start; }
.ad-body h3 { font-size: 1.2rem; }
.ad-body .hint { font-size: 0.88rem; color: var(--muted); }
.ad-login { padding: 28px 22px 34px; display: grid; gap: 18px; max-width: 420px; }
.ad-login h2 { font-size: 1.6rem; }
.ad-err { color: #B3232A; font-weight: 600; min-height: 1.4em; }
.ad-notice { background: #FFF4D6; border: 1px solid #EAC968; border-radius: 10px; padding: 14px 16px; font-size: 0.95rem; }
.ad-note { padding: 14px 16px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-size: 0.95rem; }
.svc { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 14px; }
.svc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.svc-head h4 { font-family: var(--sans); font-size: 1rem; font-weight: 650; margin-right: auto; overflow-wrap: anywhere; }
.svc-head button { min-height: 34px; padding: 0 12px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: 600 0.88rem var(--sans); cursor: pointer; }
.svc-head button:hover:not([disabled]) { border-color: var(--green); }
.svc-head button[disabled] { opacity: 0.4; cursor: not-allowed; }
.svc-head .del { color: #B3232A; border-color: #E8B5B7; }
.svc-head .del:hover { background: #B3232A; color: #fff; border-color: #B3232A; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.95rem; }
.ad-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stat { font-family: var(--display); font-size: 2.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Responsive */
@media (max-width: 960px) {
  .hero, .process, .contact { grid-template-columns: 1fr; }
  .sheet-wrap { grid-template-columns: 1fr; }
  .slip { position: static; }
  .foot { grid-template-columns: 1fr; justify-items: start; }
  .counter { justify-items: start; }
  .foot-meta { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .header-in { justify-content: space-between; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .info { grid-column: 1 / -1; }
  .price { text-align: left; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .term { min-height: 380px; }
  .term-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
