/* andreihorciu.ro — completări pentru paginile de calculatoare (dobândă, pensie, BVB).
   Culorile vin doar din tokens.css (albastrele brandului, textul și fundalurile lor). */

.tool-page [hidden] { display: none !important; }

.section--tool { padding-top: 40px; }
/* Pe o coloană, grila din site.css folosește 1fr, care nu lasă coloana sub lățimea conținutului
   (tabelul, graficul); minmax(0, 1fr) + min-width: 0 țin totul în lățimea ecranului. */
.tool-page .tool-layout > * { min-width: 0; }
@media (max-width: 920px) { .tool-page .tool-layout { grid-template-columns: minmax(0, 1fr); } }
.tool-form h2, .tool-results h2 { font-size: 1.2rem; }
.fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.fieldset legend { padding: 0; }
.field-hint.is-error { color: var(--brand-primary-dark); font-weight: 600; }
.input[aria-invalid="true"] { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(14, 91, 148, .16); }
.input::-webkit-outer-spin-button, .input::-webkit-inner-spin-button { opacity: .6; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.tool-alert { margin-bottom: 16px; }
.tool-results .stats, .tool-results .chart-panel, .tool-results .plan { transition: opacity var(--t-fast); }
.tool-results.is-stale .stats, .tool-results.is-stale .chart-panel, .tool-results.is-stale .plan, .tool-results.is-stale .data-details { opacity: .5; }

/* Cifra principală: gradient închis, ca textul alb să aibă contrast pe toată suprafața. */
.tool-page .stat--hero { background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%); }
.tool-page .stat--hero .stat-label { color: rgba(255, 255, 255, .88); }
/* Cifra principală pe un rând întreg, celelalte se împart egal pe rândul de dedesubt, oricâte sunt vizibile. */
.tool-page .stats { display: flex; flex-wrap: wrap; }
.tool-page .stats > .stat { flex: 1 1 180px; min-width: 0; }
.tool-page .stats > .stat--hero { flex-basis: 100%; }
.tool-page .stat-value { font-size: 1.25rem; font-variant-numeric: normal; overflow-wrap: break-word; }
.tool-page .stat--hero .stat-value { font-size: 1.9rem; }
.stat--wide { grid-column: 1 / -1; }

/* ---------- Grafic ---------- */
.chart-panel { margin: 0 0 22px; }
.chart-panel figcaption { margin-bottom: 6px; }
.chart-title { font-size: 1.15rem; margin-bottom: .2em; }
.chart-sub { margin: 0; font-size: .9rem; color: var(--brand-text-muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 10px 0 8px; font-size: .86rem; color: var(--brand-text-muted); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.chart { position: relative; width: 100%; min-height: 250px; border-radius: var(--r-md); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--brand-border); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: rgba(26, 43, 60, .35); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { font-family: var(--font-body); font-size: 11px; fill: var(--brand-text-muted); font-variant-numeric: tabular-nums; }
.chart .cap-label { font-family: var(--font-body); font-size: 12px; font-weight: 600; fill: var(--brand-text); }
.chart .hover-band { fill: rgba(14, 91, 148, .07); }
.chart-tip {
  position: absolute; z-index: 3; pointer-events: none; min-width: 200px;
  padding: 9px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--brand-border);
  box-shadow: var(--shadow-md); font-size: .82rem; line-height: 1.45; color: var(--brand-text-muted);
}
.tip-head { margin-bottom: 4px; }
.tip-head strong { color: var(--brand-text); font-size: .96rem; }
.tip-row { display: grid; grid-template-columns: 14px auto 1fr; gap: 8px; align-items: center; }
.tip-row strong { color: var(--brand-text); font-variant-numeric: tabular-nums; }
.tip-key { width: 12px; height: 3px; border-radius: 2px; }
.chart-help { margin: 8px 0 0; font-size: .8rem; color: var(--brand-text-muted); }

/* ---------- Tabel pe ani, pliabil ---------- */
.data-details > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.data-details > summary::-webkit-details-marker { display: none; }
.data-details > summary::before {
  content: ""; width: 9px; height: 9px; flex: none; margin-left: 2px;
  border-right: 2px solid var(--brand-primary); border-bottom: 2px solid var(--brand-primary);
  transform: rotate(-45deg); transition: transform var(--t-fast);
}
.data-details[open] > summary::before { transform: rotate(45deg); }
.data-details > summary h2 { display: inline; margin: 0; font-size: 1.15rem; }
.data-details[open] > summary { margin-bottom: 14px; }
.table-wrap--tall { max-height: 440px; overflow: auto; }
.data-details table.data th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
.data-details table.data thead th:first-child { z-index: 2; background: var(--brand-bg-alt); }
.data-details table.data tfoot th:first-child { background: var(--brand-bg-alt); }
@media (max-width: 600px) { .data-details table.data th, .data-details table.data td { padding: 9px 8px; font-size: .86rem; } }
table.data tbody th { font-weight: 600; text-align: left; }
table.data tfoot th { text-align: left; background: var(--brand-bg-alt); }

/* ---------- Explicație + CTA ---------- */
.prose-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
@media (max-width: 980px) { .prose-grid { grid-template-columns: 1fr; } }
.prose-grid .prose { max-width: 720px; }
.cta-band--compact { padding: 32px 28px; }
.cta-band--compact h2 { font-size: 1.4rem; }
@media (min-width: 981px) { .cta-band--compact { position: sticky; top: 96px; } }

/* ---------- Pensie: planul și tipărirea ---------- */
.plan h2 { font-size: 1.15rem; }
table.data--plan th { font-weight: 500; white-space: normal; text-align: left; }
.data--plan td { vertical-align: top; }
.plan-total th, .plan-total td { font-weight: 700; color: var(--brand-primary); background: var(--brand-bg-alt); }
.plan .tool-actions { margin-top: 16px; }
.print-only { display: none; }
@media (max-width: 520px) {
  table.data--plan th, table.data--plan td { padding: 9px 10px; }
  table.data--plan td { white-space: normal; min-width: 7.5em; }
}

@media print {
  .print-only { display: block; }
  .page-pensie .page-hero,
  .page-pensie main > section:not(.section--tool),
  .page-pensie .tool-form,
  .page-pensie .tool-results > :not(#plan),
  .page-pensie noscript { display: none !important; }
  .page-pensie .section--tool { padding: 0; }
  .page-pensie .tool-layout { display: block; }
  .page-pensie #plan { border: 0; padding: 0; box-shadow: none; }
  .page-pensie #plan h2 { font-size: 18pt; text-align: center; margin-bottom: 14pt; }
  .page-pensie .table-wrap { overflow: visible; border-radius: 0; border-color: var(--brand-text-muted); }
  .page-pensie .data--plan { font-size: 13pt; }
  .page-pensie .data--plan th, .page-pensie .data--plan td { border-bottom-color: var(--brand-text-muted); }
  .plan-sursa { margin-top: 12pt; font-size: 9pt; color: var(--brand-text-muted); }
}

/* ---------- BVB ---------- */
.price-date {
  display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; padding: 16px 18px;
  border-radius: var(--r-lg); background: rgba(168, 216, 240, .18); border: 1px solid rgba(59, 140, 184, .28);
}
.price-date p { margin: 0 0 6px; font-size: .92rem; line-height: 1.55; }
.price-date p:last-child { margin-bottom: 0; color: var(--brand-text-muted); font-size: .86rem; }
.price-date-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem !important; color: var(--brand-primary); }
.price-date-ico {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary)); color: #fff;
}
.price-date-ico .icon { width: 20px; height: 20px; }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 600; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--brand-primary); }

.bvb-panel { margin-top: 28px; padding: 20px; }
.bvb-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bvb-title { margin: 0; font-size: 1.15rem; }
.bvb-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bvb-wrap { max-height: 70vh; overflow: auto; }
table.data.bvb-table th, table.data.bvb-table td { padding: 8px 10px; vertical-align: middle; }
table.data.bvb-table thead th { white-space: normal; min-width: 6.5em; line-height: 1.3; z-index: 2; }
.bvb-table .cell-symbol, .bvb-table thead th:first-child, .bvb-table tfoot th {
  position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 var(--brand-border);
}
.bvb-table thead th:first-child { z-index: 3; background: var(--brand-bg-alt); }
.bvb-table tfoot th { background: var(--brand-bg-alt); }
.bvb-table tfoot td, .bvb-table tfoot th { position: sticky; bottom: 0; }
.bvb-table tfoot th { z-index: 2; }
.symbol { display: flex; align-items: center; gap: 8px; }
.symbol strong { display: block; font-size: .95rem; }
.symbol small { display: block; max-width: 15em; font-size: .74rem; font-weight: 400; line-height: 1.3; white-space: normal; color: var(--brand-text-muted); }
.symbol-remove {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none; padding: 0;
  border: 1px solid var(--brand-border); border-radius: 8px; background: #fff;
  color: var(--brand-text-muted); font: inherit; font-size: 1.05rem; line-height: 1; cursor: pointer;
}
.symbol-remove:hover { color: var(--brand-primary); border-color: var(--brand-accent-light); background: rgba(168, 216, 240, .18); }
.input--cell { width: 7.2em; padding: 7px 9px; font-size: .92rem; text-align: right; border-radius: var(--r-sm); }
.input--cell.is-edited { border-color: var(--brand-secondary); background: rgba(168, 216, 240, .16); }
.bvb-table .out--trade { font-weight: 600; color: var(--brand-primary); }
.table-hint { margin: 10px 0 0; font-size: .82rem; color: var(--brand-text-muted); }
@media (max-width: 600px) {
  .bvb-panel { padding: 14px; }
  .bvb-toolbar-actions { width: 100%; }
  .bvb-toolbar-actions .btn { flex: 1 1 auto; }
  /* Pe telefon tabelul se strânge: numele companiei rămâne doar pentru cititoarele de ecran. */
  .symbol small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .symbol { gap: 6px; }
  .symbol-remove { width: 26px; height: 26px; }
  table.data.bvb-table th, table.data.bvb-table td { padding: 7px 6px; font-size: .86rem; }
  table.data.bvb-table thead th { min-width: 0; font-size: .76rem; }
  .input--cell { width: 5.6em; padding: 6px 6px; font-size: .88rem; }
}
.chart-empty { display: grid; place-items: center; min-height: 250px; margin: 0; padding: 20px; text-align: center; color: var(--brand-text-muted); background: var(--brand-bg-alt); border-radius: var(--r-md); }
