/* Same palette and pixel font as the main site (ervinssamorokovs.dev) and the dashboard. */
:root {
  --bg: #06110a;
  --card: #0d2015;
  --border: #1d3d29;
  --text: #dcf5e3;
  --muted: #8fb39b;
  --accent: #4ade80;
  --accent-dark: #166534;
  --on-accent: #04210f;
  --danger: #f87171;
  --max: 1180px;
  --pixel: "Pixel", "Courier New", monospace; /* defined in fonts/fonts.css */

  /* Cost split chart, checked for colour-blind separation on the card background */
  --part-net: #16a34a;
  --part-pit: #d97706;
  --part-ssEmployee: #3b82f6;
  --part-ssEmployer: #c026d3;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--pixel);
  font-synthesis: none;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(700px 450px at 85% -10%, rgba(74, 222, 128, .12), transparent 70%),
    radial-gradient(500px 400px at -10% 35%, rgba(163, 230, 53, .06), transparent 70%),
    linear-gradient(rgba(74, 222, 128, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 222, 128, .035) 1px, transparent 1px);
  background-size: auto, auto, 24px 24px, 24px 24px;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 600; line-height: 1.2; margin: 0; }
::selection { background: var(--accent); color: var(--on-accent); }
.accent { color: var(--accent); }
[hidden] { display: none !important; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1rem, 5vw, 3rem);
  background: rgba(6, 17, 10, .82);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--border);
}
.nav__logo { font-weight: 700; font-size: 1.6rem; }
.nav__logo span { color: var(--accent); }

/* Language buttons and the Gross/Net switch share one look */
.lang, .switch { display: inline-flex; gap: 2px; padding: 3px; background: var(--card); border: 2px solid var(--border); }
.lang button, .switch button {
  font: 500 .85rem/1 var(--pixel); letter-spacing: .05em;
  color: var(--muted); background: none; border: 0;
  padding: .4rem .55rem; cursor: pointer; transition: color .15s, background .15s;
}
.switch { background: var(--bg); justify-self: start; }
.switch button { padding: .6rem .9rem; }
.lang button:hover, .switch button:hover { color: var(--text); }
.lang button[aria-pressed="true"], .switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
button:focus-visible, .input:focus-visible, .check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Head ---------- */
main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 clamp(1rem, 5vw, 2rem); }
.head { padding: 3rem 0 2rem; }
.head h1 { font-size: clamp(1.6rem, 5vw, 3.2rem); text-shadow: 4px 4px 0 var(--accent-dark); overflow-wrap: anywhere; }
.cursor {
  display: inline-block; width: .5em; height: .85em; margin-left: .25em; vertical-align: -.05em;
  background: var(--accent); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.head__sub { margin: .75rem 0 0; color: var(--muted); }

/* ---------- Layout ---------- */
.layout { display: grid; gap: 1.25rem; padding-bottom: 2rem; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
@media (max-width: 820px) { .layout { grid-template-columns: minmax(0, 1fr); } .head { padding-top: 2rem; } }

.tile {
  display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; margin: 0;
  padding: clamp(1rem, 3vw, 1.6rem);
  background: var(--card); border: 2px solid var(--border);
}
.tile__title { font-size: 1.05rem; }
.tile__subtitle { font-size: .9rem; color: var(--muted); padding-top: .4rem; border-top: 2px dashed var(--border); }
.tile__sub { margin: 0; color: var(--muted); font-size: .85rem; }
.tile__big {
  margin: .3rem 0 0; font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.1;
  text-shadow: 3px 3px 0 var(--accent-dark); overflow-wrap: anywhere;
}
.tile__note { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; border-left: 3px solid var(--part-pit); padding-left: .7rem; }

/* ---------- Form ---------- */
.field { display: grid; gap: .45rem; min-width: 0; }
.field__label { font-size: .8rem; color: var(--muted); }
.field__hint { display: block; margin-top: .25rem; font-size: .72rem; color: var(--muted); line-height: 1.5; }
.hours { margin: 0; padding: 1rem; display: grid; gap: .8rem; min-width: 0; border: 2px dashed var(--border); }
.hours legend { padding: 0 .4rem; }
.hours .field-row--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.hours .field-row--three { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; padding-top: .8rem; border-top: 2px dashed var(--border); }
@media (max-width: 520px) { .hours .field-row--three { grid-template-columns: minmax(0, 1fr); } }
.hours .field__hint { margin: 0; }
.hours .field .field__hint { margin-top: 0; }
.link {
  margin-left: .4rem; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1rem; }
@media (max-width: 420px) { .field-row { grid-template-columns: minmax(0, 1fr); } }

.input {
  width: 100%; min-width: 0; padding: .65rem .75rem;
  font: .9rem/1.3 var(--pixel); color: var(--text);
  background: var(--bg); border: 2px solid var(--border); border-radius: 0;
}
.input:hover { border-color: var(--accent-dark); }
.input:focus { border-color: var(--accent); }
.input--big { font-size: clamp(1.2rem, 4vw, 1.6rem); padding: .8rem .9rem; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled { opacity: .45; }
select.input { cursor: pointer; }
select.input option { background: var(--card); }

.check { display: grid; grid-template-columns: auto 1fr; gap: .75rem; align-items: start; font-size: .8rem; line-height: 1.5; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; margin: .1rem 0 0; accent-color: var(--accent); cursor: pointer; }

/* ---------- Result rows ---------- */
.rows { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem 1rem; font-size: .8rem; line-height: 1.5; }
.rows dt { color: var(--muted); }
.rows dd { margin: 0; text-align: right; white-space: nowrap; }
.rows .strong { color: var(--text); font-size: .9rem; padding-top: .35rem; border-top: 2px solid var(--border); }
.rows dd.strong { color: var(--accent); }

/* ---------- Cost split ---------- */
.split { margin: 0; display: grid; gap: .8rem; }
.split__bar { display: flex; gap: 2px; height: 22px; }
.split__seg { display: block; min-width: 3px; }
.split__seg--net { background: var(--part-net); }
.split__seg--pit { background: var(--part-pit); }
.split__seg--ssEmployee { background: var(--part-ssEmployee); }
.split__seg--ssEmployer { background: var(--part-ssEmployer); }
.split__legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .75rem; }
.split__legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: .6rem; align-items: center; }
.split__swatch { width: 12px; height: 12px; }
.split__value { color: var(--muted); white-space: nowrap; }


/* ---------- Footer ---------- */
.footer { text-align: center; padding: 2rem 1rem; font-size: .85rem; }
.footer a { color: var(--muted); }
.footer a:hover, .footer a:focus-visible { color: var(--accent); }
.noscript { margin: 1rem; padding: 1rem; border: 2px solid var(--danger); }

/* ---------- Save as PDF ---------- */
.tile__top { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; }
.btn {
  padding: .5rem .9rem; cursor: pointer;
  font: 600 .75rem/1.2 var(--pixel); color: var(--accent); background: none;
  border: 2px solid var(--border); transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); background: rgba(74, 222, 128, .08); }
.btn:disabled { opacity: .5; cursor: progress; }

@media screen { .print-only { display: none !important; } }

/* The PDF / printout: light page, no navigation or form, one column. */
@media print {
  @page { margin: 14mm; }
  :root {
    --bg: #fff; --card: #fff; --border: #c9d6cd;
    --text: #0b1a10; --muted: #4b5d51; --accent: #15803d;
  }
  body { background: #fff; font-size: 10pt; min-height: 0; }
  .nav, .footer, #form, #pdf, .cursor, .noscript, #big-label, #big { display: none !important; }
  main { max-width: none; padding: 0; }
  .head { padding: 0 0 12pt; }
  .head h1, .tile__big { text-shadow: none; }
  .head h1 { font-size: 18pt; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 10pt; padding: 0; }
  .tile { padding: 10pt 12pt; gap: 7pt; border-width: 1px; }
  .tile__big { font-size: 18pt; }
  .tile__title { font-size: 10pt; }
  .tile__sub, .tile__subtitle { font-size: 8pt; }
  .rows { gap: 1pt 12pt; font-size: 7.5pt; line-height: 1.45; }
  .rows .strong { font-size: 8pt; padding-top: 3pt; }
  .split { gap: 5pt; }
  .split__bar { height: 14px; }
  .split__legend { gap: 1pt; font-size: 7pt; }
  .tile__note { font-size: 7pt; }
  .rows, .split, .tile__note { break-inside: avoid; }
  .split__seg, .split__swatch { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-foot { margin: 12pt 0 0; font-size: 8pt; color: var(--muted); }
}
