/* „Chirie sau cumpărare?” (views/utile/chirie-sau-cumparare.ejs, public/js/utile-chirie.js).
   Culorile graficului: cumpărare = albastru #2563eb, chirie = portocaliu #d97706 (verificate pentru daltonism). */
#ut-chirie { --cc-buy: #2563eb; --cc-buy-bg: #eff6ff; --cc-rent: #d97706; --cc-rent-bg: #fffbeb; }
.cc-content { padding-bottom: 32px; }
.cc-p { color: var(--ut-text); line-height: 1.65; margin: 0 0 14px; max-width: 75ch; }
.cc-hint { font-size: .84rem; color: var(--ut-muted); line-height: 1.55; margin: 8px 0 0; }

/* formularul */
.cc-form { display: grid; gap: 12px; }
.cc-group { background: #fff; border: 1px solid var(--ut-line); border-radius: 16px; padding: 14px; }
@media (min-width: 640px) { .cc-group { padding: 16px 18px; } }
.cc-group__t { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: .95rem; font-weight: 750; color: var(--ut-ink); }
.cc-group__t .ut-icon { width: 18px; height: 18px; color: var(--ut-primary); }
.cc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .cc-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cc-field { min-width: 0; display: flex; flex-direction: column; }
.cc-field--wide { grid-column: span 2; }
@media (min-width: 900px) { .cc-field--wide { grid-column: span 1; } #cc-form .cc-group:first-child .cc-fields { grid-template-columns: 1.3fr 1.3fr 1fr; } }
.cc-field label { font-size: .8rem; font-weight: 650; color: #374151; margin-bottom: 4px; line-height: 1.3; }
.cc-field small { font-size: .72rem; color: var(--ut-muted); margin-top: 3px; line-height: 1.35; }
.cc-field input, .cc-field select, .cc-inline select { width: 100%; min-width: 0; border: 1px solid #d1d5db; border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 1rem; background: #fff; color: var(--ut-ink); }
.cc-field input:focus, .cc-inline select:focus { outline: 2px solid var(--ut-primary-100); border-color: var(--ut-primary); }
.cc-inline { display: flex; gap: 6px; align-items: center; }
.cc-inline select { width: auto; flex: none; padding-right: 28px; }
.cc-unit { flex: none; min-width: 44px; padding: 10px 10px; border-radius: 10px; background: var(--ut-line-soft); color: var(--ut-text); font-weight: 700; text-align: center; }
.cc-seg { border: 0; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cc-seg label { position: relative; flex: 1 1 0; min-width: 0; }
.cc-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.cc-seg span { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 10px; font-weight: 700; font-size: .88rem; color: var(--ut-text); cursor: pointer; text-align: center; line-height: 1.2; }
.cc-seg input:checked + span { border-color: var(--ut-primary); background: var(--ut-primary-50); color: var(--ut-primary-700); }
.cc-seg input:focus-visible + span { outline: 2px solid var(--ut-primary); outline-offset: 2px; }
.cc-more > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; cursor: pointer; list-style: none; font-weight: 750; color: var(--ut-ink); }
.cc-more > summary::-webkit-details-marker { display: none; }
.cc-more > summary span { display: inline-flex; align-items: center; gap: 8px; }
.cc-more > summary .ut-icon { width: 18px; height: 18px; color: var(--ut-primary); }
.cc-more > summary small { flex: 1; font-weight: 500; font-size: .8rem; color: var(--ut-muted); }
.cc-more__chev { transition: transform .2s; }
.cc-more[open] .cc-more__chev { transform: rotate(180deg); }
.cc-more[open] > summary { margin-bottom: 14px; }
.cc-more .cc-fields + .cc-check, .cc-check + .cc-fields { margin-top: 12px; }
.cc-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--ut-line-soft); font-size: .86rem; color: var(--ut-text); line-height: 1.45; cursor: pointer; }
.cc-check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--ut-primary); flex: none; }
.cc-check strong { display: block; color: var(--ut-ink); }
#cc-reset { margin-top: 12px; }

/* rezultatul */
.cc-result { margin-top: 16px; display: grid; gap: 14px; }
.cc-err { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--ut-warn-bg); color: var(--ut-warn); font-weight: 600; }
.cc-verdict { position: relative; overflow: hidden; padding: 18px 18px 16px; border-radius: 18px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #60a5fa 0%, transparent 55%), linear-gradient(135deg, #1d4ed8, #1e3a8a); box-shadow: 0 16px 34px -18px rgba(29, 78, 216, .7); }
.cc-verdict.is-rent { background: radial-gradient(120% 140% at 100% 0%, #fbbf24 0%, transparent 55%), linear-gradient(135deg, #b45309, #78350f); box-shadow: 0 16px 34px -18px rgba(180, 83, 9, .7); }
.cc-v__kicker { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.cc-verdict strong { display: block; margin: 2px 0 6px; font-size: clamp(1.6rem, 4.5vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.12; }
.cc-verdict p { margin: 0; font-size: .92rem; line-height: 1.5; opacity: .92; max-width: 60ch; }
.cc-v__note { margin-top: 8px !important; font-size: .82rem !important; }
.cc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .cc-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cc-stat { min-width: 0; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--ut-line); }
.cc-stat span { display: block; font-size: .74rem; font-weight: 700; color: var(--ut-muted); text-transform: uppercase; letter-spacing: .03em; }
.cc-stat strong { display: block; margin: 4px 0 2px; font-size: 1.25rem; font-weight: 800; color: var(--ut-ink); letter-spacing: -.01em; }
.cc-stat strong small { font-size: .72rem; font-weight: 600; color: var(--ut-muted); }
.cc-stat > small { display: block; font-size: .76rem; color: var(--ut-muted); line-height: 1.4; }
.cc-card { min-width: 0; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--ut-line); }
@media (min-width: 640px) { .cc-card { padding: 16px 18px; } }
.cc-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 10px; }
.cc-card__head h3 { margin: 0; font-size: 1rem; font-weight: 750; color: var(--ut-ink); }
.cc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: .8rem; color: var(--ut-text); }
.cc-legend li { display: flex; align-items: center; gap: 6px; }
.cc-legend i, .cc-k { display: inline-block; width: 14px; height: 4px; border-radius: 2px; }
.cc-k--buy { background: var(--cc-buy); }
.cc-k--rent { background: var(--cc-rent); }
.cc-legend i.cc-g-rent { background: var(--cc-rent); height: 10px; width: 10px; border-radius: 3px; }
.cc-legend i.cc-g-price { background: var(--cc-buy); height: 10px; width: 10px; border-radius: 3px; }

/* graficul averii */
.cc-chartwrap { position: relative; }
.cc-chart { display: block; max-width: 100%; height: auto; font-family: inherit; overflow: visible; margin: 0 auto; }
.cc-c-grid { stroke: var(--ut-line-soft); stroke-width: 1; }
.cc-c-ax { font-size: 11.5px; fill: var(--ut-muted); }
.cc-c-buy, .cc-c-rent { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.cc-c-buy { stroke: var(--cc-buy); }
.cc-c-rent { stroke: var(--cc-rent); }
.cc-c-lab { font-size: 12.5px; font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.cc-c-lab--buy { fill: var(--cc-buy); }
.cc-c-lab--rent { fill: #b45309; }
.cc-c-be { stroke: #16a34a; stroke-width: 1.5; stroke-dasharray: 4 4; }
.cc-c-belab { font-size: 11.5px; font-weight: 700; fill: #15803d; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.cc-c-x { stroke: #94a3b8; stroke-width: 1; }
.cc-c-dot { stroke: #fff; stroke-width: 2; pointer-events: none; }
.cc-c-dot--buy { fill: var(--cc-buy); }
.cc-c-dot--rent { fill: var(--cc-rent); }
.cc-c-hit { fill: transparent; cursor: crosshair; }
.cc-tip { position: absolute; top: 8px; z-index: 3; pointer-events: none; display: grid; gap: 3px; padding: 9px 11px; border-radius: 10px; background: var(--ut-ink); color: #fff; font-size: .8rem; line-height: 1.35; white-space: nowrap; box-shadow: 0 12px 24px -10px rgba(15, 23, 42, .5); }
.cc-tip[hidden] { display: none; }
.cc-tip span { display: flex; align-items: center; gap: 6px; color: #cbd5e1; }
.cc-tip b { color: #fff; margin-left: auto; padding-left: 10px; }
.cc-tip em { font-style: normal; color: #93c5fd; font-size: .76rem; }

/* unde se duc banii */
.cc-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.cc-chip { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--ut-line); background: #fff; color: var(--ut-text); font: inherit; font-size: .8rem; font-weight: 650; cursor: pointer; }
.cc-chip.is-on { background: var(--ut-ink); border-color: var(--ut-ink); color: #fff; }
.cc-chip:focus-visible { outline: 2px solid var(--ut-primary); outline-offset: 2px; }
.cc-split { display: grid; gap: 10px; }
@media (min-width: 760px) { .cc-split { grid-template-columns: 1fr 1fr; } }
.cc-col { padding: 12px 14px; border-radius: 14px; }
.cc-col--buy { background: var(--cc-buy-bg); }
.cc-col--rent { background: var(--cc-rent-bg); }
.cc-col h4 { margin: 0 0 8px; font-size: .92rem; font-weight: 800; }
.cc-col--buy h4 { color: var(--ut-primary-800); }
.cc-col--rent h4 { color: #92400e; }
.cc-col dl { margin: 0; }
.cc-dl { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; font-size: .86rem; border-bottom: 1px dashed rgba(15, 23, 42, .1); }
.cc-dl dt { color: var(--ut-text); }
.cc-dl dd { margin: 0; font-weight: 700; color: var(--ut-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cc-dl-total .cc-dl { border-bottom: 0; padding-top: 7px; }
.cc-dl-total dt, .cc-dl-total dd { font-weight: 800; color: #b91c1c; }
.cc-dl.is-strong { border-bottom: 0; margin-top: 4px; padding: 8px 10px; border-radius: 10px; background: #fff; }
.cc-dl.is-strong dt, .cc-dl.is-strong dd { font-weight: 800; color: var(--ut-ink); font-size: .95rem; }
.cc-dl-sub { margin: 10px 0 2px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ut-muted); }

/* sensibilitatea */
.cc-sens th, .cc-sens td { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cc-sens td.is-fast { background: #dcfce7; color: #166534; font-weight: 700; }
.cc-sens td.is-mid { background: #f0fdf4; color: #15803d; }
.cc-sens td.is-slow { background: #fffbeb; color: #92400e; }
.cc-sens td.is-rent { background: #fef2f2; color: #b91c1c; }
.cc-sens td.is-you { outline: 2px solid var(--ut-ink); outline-offset: -2px; font-weight: 800; }

/* tabelul pe ani */
.cc-years > summary, .cc-table-toggle > summary { cursor: pointer; font-weight: 700; color: var(--ut-primary-700); padding: 4px 0; }
.cc-ytable td, .cc-ytable th { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.cc-ytable th[scope=row] { text-align: center; }
.cc-ytable tr.is-buy td:nth-child(5) { color: var(--ut-primary-700); font-weight: 700; }
.cc-ytable tr:not(.is-buy) td:nth-child(6) { color: #b45309; font-weight: 700; }

/* creșterile, după Eurostat */
.cc-growth-wrap { background: #fff; border: 1px solid var(--ut-line); border-radius: 14px; padding: 10px 8px 4px; margin: 8px 0 10px; }
.cc-growth { display: block; width: 100%; height: auto; font-family: inherit; }
.cc-g-grid { stroke: var(--ut-line-soft); stroke-width: 1; }
.cc-g-ax { font-size: 11.5px; fill: var(--ut-muted); }
rect.cc-g-rent { fill: var(--cc-rent); }
rect.cc-g-price { fill: var(--cc-buy); }
rect.cc-g-rent:hover, rect.cc-g-price:hover { opacity: .8; }
@media (max-width: 640px) { .cc-growth-wrap { overflow-x: auto; } .cc-growth { width: 600px; max-width: none; } }
.cc-gtable__avg th, .cc-gtable__avg td { font-weight: 800; }

/* metoda */
.cc-steps { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 10px; color: var(--ut-text); line-height: 1.6; max-width: 80ch; }
.cc-steps strong { color: var(--ut-ink); }

/* telefon */
@media (max-width: 639px) {
  .cc-more > summary { display: grid; grid-template-columns: 1fr auto; }
  .cc-more > summary small { grid-column: 1 / -1; grid-row: 2; }
  .cc-more__chev { grid-column: 2; grid-row: 1; }
  .cc-sens { font-size: .78rem; }
  .cc-sens th, .cc-sens td { padding: 8px 6px; white-space: normal; }
  .cc-sens thead th { font-size: .66rem; }
}
