@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap');

/* ══════════════════════════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════════════════════════ */
:root {
  --main:     #2c53f0;
  --ink:      #1a1a2e;
  --paper:    #f5f3f0;
  --accent-a: #2e93c9;
  --accent-b: #5d2191;
  --muted:    #7362d1;
  --divider:  #efefef;
  --radius:   4px;

  --bg:          #f3f6fa;
  --bg-gradient: linear-gradient(129deg, #f3f6fa 0%, #dfe6eb 90%);
  --col-bg:      #ffffff;
  --row-bg:      #fbfbfb;
  --row-bg-sub:  rgba(0, 0, 0, 0.02);
  --input-bg:    #f1f1f1;
  --shadow-sm:   0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-md:   0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ══════════════════════════════════════════════════════════
   RESET
══════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ══════════════════════════════════════════════════════════
   BASIS
══════════════════════════════════════════════════════════ */
body {
  font-family: "Lexend", sans-serif;
  font-optical-sizing: auto;
  background: var(--bg);
  background: var(--bg-gradient);
  color: var(--ink);
  min-height: 100vh;
  padding: 0 0 80px;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════════ */
header {
  padding: 40px 40px 32px;
  text-align: center;
}

header h1,
header span {
  font-size: clamp(2rem, 4vw, 3.2rem);
  background: linear-gradient(90deg, #4e37ae, #3300ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 1.1px;
}

header span {
  display: block;
  font-size: 2rem;
  letter-spacing: normal;
  margin-bottom: 4px;
}

header p {
  max-width: 500px;
  display: inline-block;
  line-height: 1.55rem;
  margin-top: 8px;
  color: #4a4a6a;
  font-size: 0.9rem;
}

/* ══════════════════════════════════════════════════════════
   LAYOUT — twee kolommen
══════════════════════════════════════════════════════════ */
.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
}

.col {
  padding: 28px 28px 32px;
  background-color: var(--col-bg);
  border-radius: 10px;
  margin: 10px;
  box-shadow: var(--shadow-sm);
}

/* ── Kolomkop ── */
.col-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--divider);
}

.col-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

#col-A h2 {
  background: linear-gradient(90deg, var(--main), var(--accent-a));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#col-B h2 {
  background: linear-gradient(90deg, var(--main), var(--accent-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ══════════════════════════════════════════════════════════
   SECTIES
══════════════════════════════════════════════════════════ */
.section-label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 8px;
}

.section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 10px 0 6px;
  margin-top: 12px;
  background: none;
  border: none;
  border-top: 1px solid var(--divider);
  font-family: inherit;
  color: var(--muted);
  text-align: left;
  transition: color 0.15s;
}

.section-toggle:hover { color: var(--ink); }

.section-toggle-label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-toggle-icon {
  font-size: 0.65rem;
  transition: transform 0.2s;
}

.section-toggle[aria-expanded="false"] .section-toggle-icon {
  transform: rotate(-90deg);
}

.section-body[hidden] { display: none; }

/* ══════════════════════════════════════════════════════════
   VELD-RIJEN
══════════════════════════════════════════════════════════ */
.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background-color: var(--row-bg);
  border-radius: 5px;
  margin-bottom: 6px;
  position: relative;
}

.field-row:last-child { margin-bottom: 0; }

.field-name {
  font-size: 0.83rem;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.secondary {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Input-wrapper ── */
.input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.currency {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0 4px;
  flex-shrink: 0;
}

/* ── Getal-invoer ── */
.field-row input[type="number"] {
  font-family: "Lexend", sans-serif;
  font-size: 0.85rem;
  width: 90px;
  text-align: right;
  border: none;
  background: var(--input-bg);
  border-radius: var(--radius);
  padding: 5px 8px;
  color: var(--ink);
  outline: none;
  transition: background 0.15s;
  -moz-appearance: textfield;
}

.field-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.field-row input[type="number"]:focus {
  background: #e8e8f0;
}

/* ── Optionele velden ── */
.field-row.optional {
  opacity: 0.45;
  transition: opacity 0.2s;
}

.field-row.optional:hover { opacity: 0.85; }

.field-row.optional.active { opacity: 1; }

/* ── Toggle-knop (aan/uitzetten) ── */
.toggle-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.65rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  line-height: 1;
}

.toggle-btn.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ── Mode-toggle (bijv. mnd/jr of €/%) ── */
.mode-toggle {
  display: inline-flex;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.mode-toggle button {
  font-family: "Lexend", sans-serif;
  font-size: 0.7rem;
  padding: 5px 8px;
  border: none;
  background: var(--input-bg);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.mode-toggle button:hover { background: #e0e0e8; }

.mode-toggle button.active {
  background: var(--ink);
  color: #fff;
}

/* ── Automatisch-invulknop (13e maand) ── */
.btn-auto {
  font-family: "Lexend", sans-serif;
  font-size: 0.62rem;
  padding: 4px 8px;
  border: 1.5px solid var(--muted);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  margin-left: 4px;
}

.btn-auto:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ── Salaris-hint ── */
.salary-hint {
  font-size: 0.67rem;
  color: var(--muted);
  text-align: right;
  padding: 2px 10px 6px;
  min-height: 1.2em;
}

/* ══════════════════════════════════════════════════════════
   TOOLTIP
══════════════════════════════════════════════════════════ */
.tip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  color: var(--muted);
  font-size: 0.52rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  flex-shrink: 0;
  position: relative;
}

.tip:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--ink);
  color: #f5f5f5;
  font-size: 0.65rem;
  padding: 6px 10px;
  border-radius: var(--radius);
  z-index: 100;
  pointer-events: none;
  max-width: 240px;
  white-space: normal;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
}

/* ══════════════════════════════════════════════════════════
   SUB-BLOKKEN  (pensioen, reiskosten)
══════════════════════════════════════════════════════════ */
.sub-block {
  background: var(--row-bg-sub);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 8px 12px 6px;
  margin: 2px 0 8px;
}

.sub-block .field-row {
  background: transparent;
  padding: 5px 0;
  margin-bottom: 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sub-block .field-row:last-child { border-bottom: none; }

.sub-block .field-name { font-size: 0.75rem; }

.sub-block input[type="number"] {
  width: 80px;
  background: #eeeef5;
}

/* Berekend resultaat in sub-blok */
.sub-result {
  font-size: 0.68rem;
  color: var(--muted);
  text-align: right;
  padding: 5px 0 2px;
}

.sub-result strong { color: var(--ink); }

/* ── Checkbox-rijen ── */
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--ink);
}

.check-row:last-child { border-bottom: none; }

.check-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--ink);
  flex-shrink: 0;
}

/* ── Resultaten ── */
.results-bar {
  background: var(--ink);
  color: #f5f5f5;
  padding: 0 40px;
  max-width: 1200px;
  margin: 32px auto 0;
  border-radius: 8px;
}
.results-inner {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  align-items: stretch;
}
.result-col { padding: 24px 0; }
.result-col .total-label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 6px;
}
.result-col .total-amount {
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 600;
  line-height: 1;
}
.result-col .total-amount.col-a { color: var(--accent-a); }
.result-col .total-amount.col-b { color: var(--accent-b); }
.result-col.right { text-align: right; }
.result-sub {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 8px;
  line-height: 1.7;
}
.result-sub strong { color: #eee; }

.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #444;
  border-left: 1px solid #2a2a40;
  border-right: 1px solid #2a2a40;
}

/* ── Verschilbalk ── */
.diff-bar {
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 14px 20px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.diff-pill {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
}
.diff-pill.pos { background: #d4edde; color: #2d6a4f; }
.diff-pill.neg { background: #fde8e4; color: #c8553d; }
.diff-pill.neu { background: #f0f0f0; color: #888; }
.diff-detail { font-size: 0.75rem; color: #888; }

/* ── Breakdown tabel ── */
.breakdown {
  max-width: 1200px;
  margin: 12px auto 32px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.breakdown table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.breakdown th {
  text-align: left;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaa;
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}
.breakdown td { padding: 9px 16px; border-bottom: 1px solid #f5f5f5; }
.breakdown tr:last-child td { border-bottom: none; }
.breakdown tr:hover td { background: #fafafa; }
.note-cell { font-size: 0.65rem; color: #aaa; font-style: italic; }
.va  { color: var(--accent-a); font-weight: 600; }
.vb  { color: var(--accent-b); font-weight: 600; }
.dc  { font-weight: 600; }
.dc.pos  { color: #2d6a4f; }
.dc.neg  { color: #c8553d; }
.dc.zero { color: #aaa; }

/* ── Netto badge ── */
.netto-badge {
  font-size: 0.75rem;
  text-align: right;
  padding: 6px 0 2px;
  color: var(--muted);
}
.netto-badge strong { color: var(--ink); }
.netto-badge .disclaimer {
  display: block;
  font-size: 0.62rem;
  margin-top: 3px;
  line-height: 1.4;
  color: #aaa;
}

/* ── 13e maand auto-knop ── */
.btn-auto {
  font-family: inherit;
  font-size: 0.62rem;
  padding: 2px 7px;
  border: 1px solid var(--muted);
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.btn-auto:hover,
.btn-auto.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* Salary hint boven het salarissalaris veld */
.salary-hint {
  font-size: 0.68rem;
  color: var(--muted);
  text-align: right;
  padding: 2px 10px 4px;
  min-height: 1em;
}

@media (max-width: 1000px) {
  .results-bar { padding: 0 20px; }
  .diff-bar, .breakdown { margin-left: 10px; margin-right: 10px; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIEF
══════════════════════════════════════════════════════════ */
@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .col {
    margin: 8px 10px;
  }

  header {
    padding: 28px 20px 20px;
  }
}
