/* Global VAT Calc — design tokens + styles
   Edit brand colors in :root below. */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e3e6ef;
  --text: #171a21;
  --muted: #5b6270;
  --brand: #3b4cca;
  --brand-600: #2f3cae;
  --brand-soft: #eaecfb;
  --success: #0f7b4f;
  --danger: #b4232a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
}
.brandmark { width: 28px; height: 28px; border-radius: 8px; display: inline-block; vertical-align: -6px; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--muted); font-weight: 600; font-size: 15px; }
.nav a[aria-current="page"] { color: var(--brand); }

/* Hero */
.hero { padding: 44px 0 8px; text-align: center; }
.hero h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 0 0 12px; }
.hero p.lead { color: var(--muted); font-size: clamp(16px, 2vw, 18px); max-width: 640px; margin: 0 auto; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.calc { padding: 22px; margin: 28px 0; }

/* Form */
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
input, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 12px; width: 100%;
}
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--brand-soft); outline-offset: 1px; border-color: var(--brand);
}
input[aria-invalid="true"] { border-color: var(--danger); }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* Mode toggle */
.modes { display: flex; gap: 8px; flex-wrap: wrap; }
.modes label {
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px;
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); background: var(--surface);
}
.modes input { position: absolute; opacity: 0; width: 0; height: 0; }
.modes input:checked + span { color: #fff; }
.modes label:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Results */
.results {
  display: grid; gap: 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-top: 6px;
}
@media (min-width: 620px) { .results { grid-template-columns: repeat(3, 1fr); } }
.res { display: flex; flex-direction: column; gap: 2px; }
.res .k { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.res .v { font-size: clamp(20px, 3vw, 26px); font-weight: 800; }
.res.total .v { color: var(--brand); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: var(--radius-sm);
  padding: 11px 16px; border: 1px solid var(--brand); background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-600); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Sections */
section.block { padding: 26px 0; }
h2 { font-size: clamp(21px, 2.6vw, 26px); margin: 0 0 10px; }
h3 { font-size: 18px; margin: 22px 0 6px; }
p, li { color: var(--text); }
.muted { color: var(--muted); }

/* FAQ */
details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 10px 0;
}
details summary { cursor: pointer; font-weight: 700; }
details p { margin: 10px 0 0; color: var(--muted); }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 520px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 15px; }
th { background: var(--surface-2); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }

.notice {
  background: #fff8e6; border: 1px solid #f2dfa8; color: #6b5300;
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin: 16px 0;
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 36px; }
.site-footer .wrap { padding: 26px 20px; display: grid; gap: 14px; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); font-size: 14px; }
.site-footer small { color: var(--muted); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
