/* ==========================================================
   CAR CSR – simulator.css
   Simulator rate împrumut
   ========================================================== */

.sim { display: grid; grid-template-columns: .85fr 1.15fr; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.sim-controls { padding: 2.25rem; background: var(--ice); }
.sim-controls h3 { margin-bottom: 1.5rem; }
.sim-result { padding: 2.25rem; min-width: 0; }

/* Butoane segmentate */
.seg { border: 0; padding: 0; margin: 0 0 1.5rem; }
.seg legend { padding: 0; font-weight: 700; color: var(--navy); margin-bottom: .6rem; font-size: .98rem; }
.seg-options { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .3rem; background: #e3ebf8; border-radius: 14px; }
.seg-options input { position: absolute; opacity: 0; pointer-events: none; }
.seg-options label { display: block; text-align: center; padding: .7rem .5rem; border-radius: 11px; cursor: pointer; font-weight: 700; font-size: .95rem; color: var(--muted); line-height: 1.25; transition: background-color .25s, color .25s, box-shadow .25s; }
.seg-options label small { display: block; font-weight: 600; font-size: .78rem; opacity: .85; }
.seg-options input:checked + label { background: #fff; color: var(--blue); box-shadow: 0 4px 14px rgba(10, 35, 66, .14); }
.seg-options input:focus-visible + label { outline: 3px solid var(--gold-light); outline-offset: 2px; }

/* Câmpuri */
.sim .field { margin-bottom: 1.5rem; }
.sim .field-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.sim .field label { font-weight: 700; color: var(--navy); font-size: .98rem; }
.sim .field output { font-family: var(--font-head); font-size: 1.3rem; color: var(--blue); }
.amount-input { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .2rem .9rem; transition: border-color .2s, box-shadow .2s; }
.amount-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 95, 191, .15); }
.amount-input input { flex: 1; border: 0; outline: 0; background: transparent; font: 700 1.5rem var(--font-head); color: var(--navy); padding: .55rem 0; min-width: 0; width: 100%; -moz-appearance: textfield; }
.amount-input input::-webkit-outer-spin-button, .amount-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-input span { font-weight: 800; color: var(--gold); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background-color: var(--line); outline-offset: 8px; cursor: pointer; background-image: linear-gradient(var(--blue), var(--blue)); background-repeat: no-repeat; background-size: var(--fill, 0%) 100%; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 4px solid var(--blue); box-shadow: 0 2px 8px rgba(10, 35, 66, .25); transition: transform .15s; }
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--blue); box-shadow: 0 2px 8px rgba(10, 35, 66, .25); }
.range-scale { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); font-weight: 600; margin-top: .45rem; }

.sim-rate { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border-radius: var(--radius-sm); background: #fff; border: 1px dashed #b7cdee; margin-bottom: 1rem; }
.sim-rate span { color: var(--muted); font-size: .95rem; }
.sim-rate strong { font-family: var(--font-head); font-size: 1.5rem; color: var(--blue); }
.sim-note { font-size: .85rem; color: var(--muted); margin: 0; line-height: 1.5; }

/* Rezultat */
.sim-hero { display: grid; grid-template-columns: 1fr 150px; gap: 1.25rem; align-items: center; margin-bottom: 1.5rem; }
.sim-label { color: var(--muted); font-weight: 600; margin: 0; font-size: .95rem; }
.sim-payment { font-family: var(--font-head); font-size: clamp(2.3rem, 4.6vw, 3.4rem); color: var(--navy); font-weight: 600; line-height: 1.1; margin: .15rem 0 .2rem; overflow-wrap: anywhere; }
.sim-payment small { font-size: .42em; color: var(--gold); font-family: var(--font-body); font-weight: 800; }
.sim-payment-sub { color: var(--muted); font-size: .92rem; margin: 0; }
.sim .ring { width: 150px; height: 150px; }
.sim .ring circle { stroke-width: 15; }
.sim .ring .arc { animation: none; transition: stroke-dasharray .7s var(--ease); }
.sim .ring-center strong { font-size: 1.5rem; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.5rem; }
.kpi { padding: .9rem 1.05rem; border-radius: var(--radius-sm); background: var(--ice); border: 1px solid var(--line); }
.kpi span { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; line-height: 1.3; }
.kpi strong { display: block; font-family: var(--font-head); font-size: 1.3rem; color: var(--navy); margin-top: .1rem; }
.kpi--gold { background: #fff8e6; border-color: #f0dca4; }
.kpi--blue { background: var(--sky); border-color: #c7d9f3; }

.sim-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .85rem; color: var(--muted); font-weight: 600; margin-bottom: .6rem; }
.sim-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; }
.sim-bars { height: 150px; display: flex; align-items: flex-end; gap: 3px; border-bottom: 2px solid var(--line); padding-top: .4rem; }
.sim-bar { flex: 1; min-width: 3px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.sim-bar b, .sim-bar i { display: block; width: 100%; transition: height .5s var(--ease); }
.sim-bar i { background: var(--gold-light); border-radius: 3px 3px 0 0; }
.sim-bar b { background: linear-gradient(var(--blue), #5b93e0); }
.sim-bar i + b { border-radius: 0; }
.sim-bars-legend { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: .4rem; }

.sim-toggle { margin-top: 1.4rem; display: inline-flex; align-items: center; gap: .55rem; }
.sim-toggle svg { transition: transform .3s var(--ease); }
.sim-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.sim-schedule { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.sim-schedule.open { grid-template-rows: 1fr; }
.sim-schedule > div { overflow: hidden; min-height: 0; }

.sim-foot { margin-top: 1.5rem; display: grid; gap: .6rem; }
.sim-foot p { margin: 0; font-size: .9rem; color: var(--muted); line-height: 1.5; }
.sim-foot .ok { color: var(--teal); font-weight: 700; }

@media (max-width: 900px) { .sim { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .sim-controls, .sim-result { padding: 1.5rem; }
  .sim-hero { grid-template-columns: 1fr; justify-items: start; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi strong { font-size: 1.1rem; }
}
