/* Calculator HOMA-IR — pagina statică /calculator-homa-ir (TSK-164).
   După mock-up-ul aprobat CalculatorHoma.dc.html (desktop) și CalculatorHomaMobile.dc.html (mobil).
   Tokenii, navbar-ul, foile, legăturile, banda și subsolul sunt în /pagini-publice/comun.css
   (încărcat înainte); aici rămâne doar ce e specific calculatorului.
   Fără stiluri inline: CSP-ul de producție nu are 'unsafe-inline'. */

/* ── Calculator ── */
.homa-calc { padding: 28px 32px; display: flex; gap: 32px; flex-wrap: wrap; align-items: stretch; }
.homa-calc__form, .homa-calc__out { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; }
.homa-calc__form { gap: 22px; }

.homa-field { display: flex; flex-direction: column; gap: 6px; }
.homa-field__label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-2); }
.homa-field__row { display: flex; gap: 10px; align-items: center; }
.homa-field__hint { font-size: 13px; line-height: 18px; color: var(--text-2); }

.homa-input {
  flex-grow: 1; min-width: 0;
  display: flex; align-items: center; height: 52px; padding: 0 14px;
  background: var(--surface-2); border-radius: var(--gm-radius-md);
}
.homa-input:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.homa-input input {
  flex-grow: 1; min-width: 0; width: 100%; height: 100%;
  border: 0; background: transparent; outline: none; padding: 0;
  font-family: var(--font-sans); font-variant-numeric: tabular-nums;
  font-size: 22px; font-weight: 500; letter-spacing: -0.01em; color: var(--text);
}

/* Panoul cu rezultatul */
.homa-panel {
  display: flex; flex-direction: column; gap: 14px;
  padding: 28px; border-radius: var(--gm-radius-lg); background: var(--bg-2);
}
.homa-panel--empty { justify-content: center; gap: 8px; min-height: 260px; }
.homa-panel__label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-2); }
.homa-panel__text { font-size: 15px; line-height: 23px; color: var(--text); }

.homa-result { --state: var(--optim); --state-wash: var(--optim-wash); }
.homa-result.is-alerta { --state: var(--alerta); --state-wash: var(--alerta-wash); }
.homa-result__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.homa-result__value {
  font-family: var(--font-sans); font-variant-numeric: tabular-nums;
  font-size: 76px; line-height: 1; font-weight: 500; letter-spacing: -0.04em;
  color: var(--state);
}
.homa-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: var(--gm-radius-pill); background: var(--state-wash); color: var(--state);
  font-size: 13px; line-height: 18px; font-weight: 500;
}
.homa-badge__dot { width: 8px; height: 8px; border-radius: var(--gm-radius-pill); background: var(--state); }

/* Bara 0 → 5+, limita de laborator (2) punctată */
.homa-bar { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.homa-bar__track { position: relative; height: 22px; }
.homa-bar__rail { position: absolute; left: 0; right: 0; top: 8px; height: 6px; border-radius: var(--gm-radius-pill); background: var(--border); }
.homa-bar__limit { position: absolute; left: 40%; top: 0; height: 22px; border-left: 2px dashed var(--border-strong); }
.homa-bar__marker {
  position: absolute; left: 0; top: 3px; width: 16px; height: 16px; margin-left: -8px;
  border-radius: var(--gm-radius-pill); background: var(--state); box-shadow: 0 0 0 3px var(--surface);
  transition: left 180ms ease-out;
}
.homa-bar__scale {
  position: relative; height: 16px;
  font-variant-numeric: tabular-nums; font-size: 12px; line-height: 16px; color: var(--text-3);
}
.homa-bar__scale span { position: absolute; }
.homa-bar__0 { left: 0; }
.homa-bar__2 { left: 40%; margin-left: -18px; width: 36px; text-align: center; }
.homa-bar__5 { right: 0; }

.homa-result__formula { font-variant-numeric: tabular-nums; font-size: 13px; line-height: 18px; color: var(--text-2); }

/* ── Despre HOMA-IR ── */
.homa-about { padding: 28px 32px 12px; display: flex; flex-direction: column; gap: 8px; }
.homa-rows { display: flex; flex-direction: column; }
.homa-row { display: flex; gap: 32px; padding: 18px 0; }
.homa-row + .homa-row { border-top: 1px solid var(--border); }
.homa-row dt { width: 200px; flex-shrink: 0; font-size: 15px; line-height: 23px; font-weight: 500; }
.homa-row dd { font-size: 15px; line-height: 23px; color: var(--text-2); max-width: 640px; }
.homa-row a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── Cu ce se leagă HOMA-IR ── */
.homa-links { padding: 28px 32px 12px; display: flex; flex-direction: column; gap: 20px; }

.homa-group { display: flex; flex-direction: column; }
.homa-group h3 { padding: 6px 0 4px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-2); }
.homa-edge { display: flex; align-items: center; gap: 24px; padding: 14px 0; border-top: 1px solid var(--border); }
.homa-edge__name { width: 230px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
.homa-edge__title { font-size: 15px; line-height: 20px; font-weight: 500; }
.homa-edge__strength { font-size: 13px; line-height: 18px; color: var(--text-3); }
.homa-edge__text { flex-grow: 1; font-size: 14px; line-height: 21px; color: var(--text-2); }
.homa-edge .pp-link { flex-shrink: 0; height: 44px; padding: 0 4px; }

/* ── Mobil (mock-up la 390px) ── */
@media (max-width: 720px) {
  .homa-calc { padding: 22px 20px; gap: 20px; }
  .homa-calc__form { gap: 20px; }
  .homa-panel { padding: 20px; }
  .homa-result__value { font-size: 56px; }

  .homa-about { padding: 22px 20px 8px; }
  .homa-row { flex-direction: column; gap: 4px; }
  .homa-row dt { width: auto; }

  .homa-links { padding: 22px 20px 8px; }
  .homa-edge { flex-direction: column; align-items: stretch; gap: 6px; padding: 16px 0; }
  .homa-edge__name { width: auto; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; }
  .homa-edge__strength { white-space: nowrap; }
  .homa-edge .pp-link { align-self: flex-start; height: auto; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .homa-bar__marker { transition: none; }
}
