/* ==========================================================================
   producenti — Task 8: #/prihvatljivost (nz-pv-*), the company eligibility checks.

   Three check cards (inputs + live result), a sticky summary with Spremi / Obriši,
   threshold meters, per-year revenue rows and the .ics reminder. Shared tool layout
   (nz-tool, nz-seg, nz-field, nz-check, nz-badge) comes from tools.css / components.css.
   Tokens only: no literal colours or fonts. Aning skin: Poppins labels, JetBrains Mono
   only for the per-year share column; 12px cards, pill meters.
   ========================================================================== */

.nz-pv-lead2 {
  max-width: 78ch;
  margin-top: calc(-1 * var(--s-4));
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-dim);
}
.nz-pv-lead2 .nz-cites {
  display: inline-flex;
  vertical-align: baseline;
}
.nz-pv-vodic {
  color: var(--paper);
  font-weight: 600;
  text-decoration-color: var(--red);
}
.nz-pv-vodic:hover {
  color: var(--red-text);
}

.nz-pv-checks {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

/* ── Check card ───────────────────────────────────────────────────────── */
.nz-pv-card {
  --surface: var(--panel);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  min-width: 0;
  padding: var(--s-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--panel);
  scroll-margin-top: 72px;
}
.nz-pv-card__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-3) var(--s-4);
  align-items: start;
}
.nz-pv-card__num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.nz-pv-card__headtext {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.nz-pv-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.nz-pv-card__intro {
  max-width: 72ch;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--paper-dim);
}
.nz-pv-card__intro .nz-cites {
  display: inline-flex;
}

/* ── Inputs ───────────────────────────────────────────────────────────── */
.nz-pv-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-5) var(--s-5);
  align-items: start;
  min-width: 0;
}
.nz-pv-group,
.nz-pv-note,
.nz-pv-flag,
.nz-pv-years,
.nz-pv-yearhint {
  grid-column: 1 / -1;
}
.nz-pv-group {
  margin: var(--s-2) 0 calc(-1 * var(--s-2));
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
}
.nz-pv-group:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.nz-pv-fields input[type='text'] {
  font-variant-numeric: tabular-nums;
}
.nz-pv-signed .nz-seg__legend {
  margin-bottom: 6px;
}
.nz-pv-signed .nz-seg__label {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
}
.nz-pv-flag {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 78ch;
}
.nz-pv-flag .nz-field__hint {
  padding-left: 28px;
}
.nz-pv-flag .nz-field__hint .nz-cites {
  display: inline-flex;
  vertical-align: baseline;
}
.nz-pv-note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
}
.nz-pv-note:empty {
  display: none;
}
.nz-pv-equity {
  margin-top: calc(-1 * var(--s-2));
  font-family: var(--font-body);
  font-size: 12.5px;
}
.nz-pv-fields--dates {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.nz-pv-fields--dates input[type='date'] {
  font-family: var(--font-body);
  font-size: 15px;
}

/* Revenue: one row per year */
.nz-pv-years {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.nz-pv-year {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr) 84px;
  gap: var(--s-3) var(--s-4);
  align-items: end;
  padding: var(--s-3) 0;
  border-top: 1px solid var(--rule);
}
.nz-pv-year:last-child {
  border-bottom: 1px solid var(--rule);
}
.nz-pv-year__y {
  align-self: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.nz-pv-year__out {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-bottom: 8px;
}
.nz-pv-year__lbl {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.nz-pv-year__share {
  font-family: var(--font-mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* ── Result ───────────────────────────────────────────────────────────── */
.nz-pv-result {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  min-width: 0;
  padding-top: var(--s-5);
  border-top: 1.5px solid var(--rule);
}
.nz-pv-result.is-bad {
  border-top-color: var(--red);
}
.nz-pv-result__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.nz-pv-result__head i {
  flex: 0 0 auto;
  font-size: 17px;
  color: var(--text-dim);
}
.nz-pv-result.is-ok .nz-pv-result__head i {
  color: var(--hue-green);
}
.nz-pv-result.is-bad .nz-pv-result__head i {
  color: var(--red-text);
}
.nz-pv-result.is-warn .nz-pv-result__head i {
  color: var(--hue-amber);
}
.nz-pv-result.is-none .nz-pv-result__head {
  font-size: 17px;
  color: var(--paper-dim);
}
.nz-pv-result__sub {
  max-width: 72ch;
  margin-top: calc(-1 * var(--s-2));
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--paper-dim);
}

/* Threshold meter: fill = the value, a mark at the threshold */
.nz-pv-meter {
  position: relative;
  padding-top: 20px;
}
.nz-pv-meter__track {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--rule);
}
.nz-pv-meter__fill {
  display: block;
  width: var(--fill, 0);
  height: 100%;
  background: var(--hue-green);
  transition: width var(--dur-panel) var(--ease-panel);
}
.nz-pv-meter.is-bad .nz-pv-meter__fill {
  background: var(--red-fill);
}
.nz-pv-meter__mark {
  position: absolute;
  top: 0;
  bottom: -4px;
  left: var(--at, 50%);
  width: 0;
  border-left: 2px solid var(--paper);
}
.nz-pv-meter__mark span {
  position: absolute;
  top: -1px;
  right: 6px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-dim);
}

.nz-pv-figs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--s-3) var(--s-5);
  margin: 0;
}
.nz-pv-fig {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.nz-pv-fig dt {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.nz-pv-fig dd {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.nz-pv-reasons {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nz-pv-reason {
  max-width: 78ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--paper-dim);
}
.nz-pv-reason .nz-cites {
  display: inline-flex;
  vertical-align: baseline;
}

/* "Zašto je j.d.o.o. osjetljiviji" */
.nz-pv-why {
  border-top: 1px solid var(--rule);
}
.nz-pv-why summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding-top: var(--s-3);
  font-weight: 600;
  cursor: pointer;
}
.nz-pv-why summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.nz-pv-why__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  max-width: 72ch;
  padding-top: var(--s-2);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--paper-dim);
}
.nz-pv-why__body .nz-cites {
  display: inline-flex;
}

/* .ics reminder */
.nz-pv-ics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
}
.nz-pv-ics__hint {
  flex: 1 1 220px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* ── Summary panel ────────────────────────────────────────────────────── */
.nz-pv-summary {
  --surface: var(--panel);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--panel);
}
.nz-pv-sum {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nz-pv-sum__row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: start;
  padding: var(--s-3) 0;
  border-top: 1px solid var(--rule);
}
.nz-pv-sum__num {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
}
.nz-pv-sum__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.nz-pv-sum__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.nz-pv-sum__detail {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-dim);
}
.nz-pv-sum__detail:empty {
  display: none;
}
.nz-pv-sum__row .nz-badge {
  margin-top: 1px;
}
.nz-pv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.nz-pv-saved {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-dim);
}
.nz-pv-saved[data-state='dirty'] {
  color: var(--paper);
}
.nz-pv-privacy {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

.nz-pv-cta {
  padding-top: var(--s-5);
  border-top: 1px solid var(--rule);
}

/* ── Narrow screens ───────────────────────────────────────────────────── */
@media (max-width: 819.98px) {
  .nz-pv-card,
  .nz-pv-summary {
    padding: var(--s-4);
  }
  .nz-pv-card__title {
    font-size: 21px;
  }
  .nz-pv-card__num {
    font-size: 28px;
  }
  .nz-pv-signed .nz-seg__label {
    min-height: var(--tap);
  }
  .nz-pv-flag .nz-check input {
    width: 22px;
    height: 22px;
  }
  .nz-pv-flag .nz-field__hint {
    padding-left: 32px;
  }
  .nz-pv-why summary {
    min-height: var(--tap);
  }
  .nz-pv-fields input[type='text'],
  .nz-pv-fields input[type='date'],
  .nz-pv-fields select {
    min-height: var(--tap);
    font-size: 16px;
  }
}
@media (max-width: 559.98px) {
  /* Number and title on one line, the intro under both. */
  .nz-pv-card__head {
    align-items: baseline;
  }
  .nz-pv-card__headtext {
    display: contents;
  }
  .nz-pv-card__intro {
    grid-column: 1 / -1;
  }
  .nz-pv-year {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .nz-pv-year__y {
    grid-column: 1 / -1;
  }
  .nz-pv-year__out {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 0;
  }
  .nz-pv-meter__mark span {
    font-size: 9.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nz-pv-meter__fill {
    transition: none;
  }
}

@media print {
  .nz-pv-actions,
  .nz-pv-privacy,
  .nz-pv-ics,
  .nz-pv-cta {
    display: none !important;
  }
  .nz-pv-card,
  .nz-pv-summary {
    break-inside: avoid;
  }
  .nz-pv-why:not([open]) {
    display: none;
  }
}
