/* ============================================================
   Sanitas CAR — landing page & simulator
   Paletă: roșu de brand extras din logo (#EA1B23) + neutre reci
   ============================================================ */

:root {
  /* Pagina are o identitate deschisa; fixam schema ca browserul sa nu
     recoloreze singur controalele (date, range) in modul intunecat. */
  color-scheme: light;

  --red: #EA1B23;
  --red-dark: #C2141B;
  --red-soft: #FDECEC;
  --ink: #16181D;
  --ink-2: #3C424E;
  --ink-3: #6B7280;
  --line: #E4E7EC;
  --bg: #FFFFFF;
  --bg-2: #F7F8FA;
  --ok: #12855B;
  --ok-soft: #E8F6EF;
  --warn: #B4232A;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 6px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .18);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, legend { color: var(--ink); line-height: 1.18; margin: 0; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.25rem); }
h3 { font-size: 1.125rem; }
p { margin: 0; }
img { max-width: 100%; height: auto; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid rgba(234, 27, 35, .45); outline-offset: 2px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; line-height: 1;
  padding: 14px 24px; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 8px 20px -8px rgba(234, 27, 35, .65); }
.btn-primary:hover { background: var(--red-dark); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink-3); }
.btn-ghost { background: var(--red-soft); color: var(--red-dark); }
.btn-ghost:hover { background: #FBDDDE; }
.btn-sm { padding: 10px 18px; font-size: .875rem; }
.btn-lg { padding: 17px 30px; font-size: 1.0625rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: var(--ink); font-size: 1.0625rem; letter-spacing: -.02em; }
.brand-text small { color: var(--ink-3); font-size: .75rem; }
.site-nav { margin-left: auto; display: flex; gap: 26px; }
.site-nav a { color: var(--ink-2); font-weight: 500; font-size: .9375rem; }
.site-nav a:hover { color: var(--red); text-decoration: none; }
.header-cta { flex-shrink: 0; }

@media (max-width: 860px) {
  .site-nav { display: none; }
  .header-cta { margin-left: auto; }
}
@media (max-width: 560px) {
  /* Pe ecrane inguste pastram doar numele, ca headerul sa ramana pe un rand. */
  .header-inner { gap: 12px; min-height: 64px; }
  .brand-text strong { white-space: nowrap; }
  .brand-text small { display: none; }
  .brand img { width: 42px; height: auto; }
  .header-cta { padding: 9px 14px; font-size: .8125rem; }
}

/* ---------------- Hero ---------------- */
.hero {
  background:
    radial-gradient(1000px 460px at 88% -10%, rgba(234, 27, 35, .10), transparent 62%),
    linear-gradient(180deg, #fff 0%, var(--bg-2) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center;
  padding-block: clamp(48px, 7vw, 92px);
}
.eyebrow {
  display: inline-block; font-size: .8125rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--red-dark);
  background: var(--red-soft); padding: 7px 14px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 em { font-style: normal; color: var(--red); }
.lead { font-size: clamp(1.0625rem, 1.6vw, 1.1875rem); color: var(--ink-2); margin-top: 20px; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 34px 0 0; padding: 0; }
.hero-badges li { display: flex; align-items: center; gap: 9px; font-size: .9375rem; color: var(--ink-2); }
.hero-badges strong { color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex-shrink: 0; }

.hero-visual { display: flex; justify-content: center; }
.hero-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 40px 34px; text-align: center; max-width: 320px;
}
.hero-card img { margin-inline: auto; }
.hero-card-title { margin-top: 22px; font-weight: 800; font-size: 1.375rem; color: var(--ink); letter-spacing: -.02em; }
.hero-card-sub { color: var(--ink-3); font-size: .9375rem; margin-top: 6px; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .hero-card { padding: 28px; max-width: 260px; }
  .hero-card img { width: 104px; height: auto; }
}

/* ---------------- Pași ---------------- */
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  padding-block: clamp(40px, 6vw, 68px);
}
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px 28px; box-shadow: var(--shadow-sm);
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--red); color: #fff; font-weight: 800; margin-bottom: 16px;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--ink-3); font-size: .9375rem; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

/* ---------------- Section head ---------------- */
.section-head { max-width: 62ch; margin-bottom: 32px; }
.section-head p { color: var(--ink-3); margin-top: 10px; font-size: 1.0625rem; }

/* ---------------- Simulator ---------------- */
.simulator-section { background: var(--bg-2); border-block: 1px solid var(--line); padding-block: clamp(48px, 7vw, 84px); }

.sim-card {
  display: grid; grid-template-columns: 1.25fr .75fr;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.sim-controls { padding: clamp(24px, 3.4vw, 40px); display: flex; flex-direction: column; gap: 38px; }

.field-label {
  display: block; font-weight: 700; color: var(--ink); font-size: .9375rem;
  letter-spacing: -.01em; margin-bottom: 14px;
}

.amount-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.amount-btn {
  font: inherit; font-weight: 700; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 16px 6px; cursor: pointer; text-align: center; line-height: 1.2;
  transition: all .18s ease;
}
.amount-btn span { display: block; font-size: .75rem; font-weight: 500; color: var(--ink-3); margin-top: 3px; }
.amount-btn:hover { border-color: var(--red); transform: translateY(-2px); }
.amount-btn.is-active {
  background: var(--red); border-color: var(--red); color: #fff;
  box-shadow: 0 10px 22px -10px rgba(234, 27, 35, .8);
}
.amount-btn.is-active span { color: rgba(255, 255, 255, .82); }
@media (max-width: 620px) { .amount-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.slider-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.slider-head .field-label { margin-bottom: 14px; }
.months-badge {
  font-weight: 800; color: var(--red-dark); background: var(--red-soft);
  padding: 6px 14px; border-radius: 999px; font-size: .9375rem; font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 30px; background: transparent; cursor: pointer; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, var(--red) 0 var(--fill, 50%), var(--line) var(--fill, 50%) 100%);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 30px; height: 30px; margin-top: -10px; border-radius: 50%;
  background: #fff; border: 3px solid var(--red);
  box-shadow: 0 3px 10px rgba(16, 24, 40, .22); transition: transform .12s ease;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]::-moz-range-track { height: 10px; border-radius: 999px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 10px; border-radius: 999px; background: var(--red); }
input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%; background: #fff;
  border: 3px solid var(--red); box-shadow: 0 3px 10px rgba(16, 24, 40, .22);
}

.slider-ticks { display: flex; justify-content: space-between; margin-top: 6px; }
.tick {
  font: inherit; font-size: .8125rem; font-weight: 600; color: var(--ink-3);
  background: none; border: 0; padding: 4px 8px; border-radius: 8px; cursor: pointer;
}
.tick:hover, .tick.is-active { color: var(--red-dark); background: var(--red-soft); }
.hint { color: var(--ink-3); font-size: .8125rem; margin-top: 10px; }

.sim-result {
  background: linear-gradient(165deg, #1B1D23 0%, #2B2F39 100%);
  color: #fff; padding: clamp(24px, 3.4vw, 40px);
  display: flex; flex-direction: column; gap: 20px;
}
.result-caption { color: rgba(255, 255, 255, .68); font-size: .875rem; font-weight: 600; letter-spacing: .02em; }
.result-value {
  font-size: clamp(2.5rem, 5.2vw, 3.5rem); font-weight: 800; line-height: 1;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: #fff;
}
.result-value small { font-size: .375em; font-weight: 600; color: rgba(255, 255, 255, .7); }
.result-rows { margin: 0; display: flex; flex-direction: column; gap: 0; }
.result-rows > div {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 11px 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .9375rem;
}
.result-rows dt { color: rgba(255, 255, 255, .66); margin: 0; }
.result-rows dd { margin: 0; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.sim-result .btn { margin-top: auto; }

@media (max-width: 900px) { .sim-card { grid-template-columns: 1fr; } }

/* ---------------- Tabel ---------------- */
.table-section { padding-block: clamp(48px, 7vw, 84px); }
.table-scroll {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); background: #fff;
}
.ref-table { width: 100%; border-collapse: collapse; min-width: 720px; font-size: .9375rem; }
.ref-table th, .ref-table td { padding: 15px 18px; text-align: right; white-space: nowrap; }
.ref-table th:first-child, .ref-table td:first-child { text-align: left; }
.ref-table thead th {
  background: var(--bg-2); color: var(--ink); font-weight: 700; font-size: .8125rem;
  text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line);
}
.ref-table tbody td { border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ref-table tbody tr:last-child td { border-bottom: 0; }
.ref-table tbody tr:hover { background: #FCFCFD; }
.ref-table tbody td:first-child { font-weight: 700; color: var(--ink); }
.ref-table tr.is-current { background: var(--red-soft) !important; }
.ref-table td.is-current-cell { color: var(--red-dark); font-weight: 800; }

/* ---------------- Formular ---------------- */
.form-section { background: var(--bg-2); border-top: 1px solid var(--line); padding-block: clamp(48px, 7vw, 84px); }
.loan-form {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: clamp(22px, 3.4vw, 40px);
  display: flex; flex-direction: column; gap: 28px;
}
.form-block { border: 0; padding: 0; margin: 0; }
.form-block legend {
  display: flex; align-items: center; gap: 12px; font-size: 1.125rem;
  padding: 0 0 18px; width: 100%;
}
.legend-idx {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: var(--red-soft); color: var(--red-dark); font-weight: 800; font-size: .9375rem;
}
 /* minmax(0, 1fr) — altfel input[type=date] isi impune min-content si lateste grila */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: 1 / -1; }
@media (max-width: 700px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
}

.form-field { display: flex; flex-direction: column; min-width: 0; }
.form-field label { font-weight: 600; color: var(--ink); font-size: .875rem; margin-bottom: 7px; }
.req { color: var(--red); }

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="date"] {
  font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 11px; padding: 13px 15px;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
  width: 100%; min-height: 50px;
}
.form-field input::placeholder { color: #A6ADBB; }
.form-field input:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 4px rgba(234, 27, 35, .12); }

.form-field.is-valid input { border-color: var(--ok); background: var(--ok-soft); }
.form-field.is-valid input:focus { box-shadow: 0 0 0 4px rgba(18, 133, 91, .14); }
.form-field.is-invalid input { border-color: var(--warn); background: #FEF3F3; }
.form-field.is-invalid input:focus { box-shadow: 0 0 0 4px rgba(180, 35, 42, .12); }

.field-msg { font-size: .8125rem; color: var(--ink-3); margin-top: 6px; min-height: 1.2em; }
.form-field.is-valid .field-msg { color: var(--ok); font-weight: 600; }
.form-field.is-invalid .field-msg { color: var(--warn); font-weight: 600; }

#cnp, #iban { font-variant-numeric: tabular-nums; letter-spacing: .06em; }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 12px; }
.summary-grid > div {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.summary-grid span { font-size: .75rem; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.summary-grid strong { color: var(--ink); font-size: 1.0625rem; font-variant-numeric: tabular-nums; }

.consent { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400 !important; font-size: .9375rem !important; color: var(--ink-2) !important; margin: 0 !important; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--red); flex-shrink: 0; margin-top: 1px; cursor: pointer; }
.consent.is-invalid { border-color: var(--warn); background: #FEF3F3; }

.form-actions { display: flex; flex-wrap: wrap; gap: 12px; }
/* Textul lung al butoanelor trebuie sa se poata rupe pe ecrane mici. */
.form-actions .btn { flex: 1 1 240px; min-width: 0; white-space: normal; text-align: center; line-height: 1.3; }

.form-status { font-size: .9375rem; font-weight: 600; min-height: 1.4em; }
.form-status.is-ok { color: var(--ok); }
.form-status.is-err { color: var(--warn); }
.form-status.is-busy { color: var(--ink-3); }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .72); padding-block: 44px; }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: 30px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand strong { color: #fff; display: block; font-size: 1.0625rem; }
.footer-brand p { font-size: .875rem; margin: 2px 0 0; }
.footer-note { font-size: .8125rem; line-height: 1.6; color: rgba(255, 255, 255, .58); }
@media (max-width: 780px) { .footer-inner { grid-template-columns: 1fr; } }

/* ---------------- Modal PDF ---------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
/* Fara aceasta regula, .modal{display:flex} ar bate display:none al atributului [hidden]. */
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16, 18, 23, .6); backdrop-filter: blur(3px); }
.modal-panel {
  position: relative; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(880px, 100%); max-height: min(92vh, 900px); display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-close { font-size: 1.75rem; line-height: 1; background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 20px 24px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.modal-msg { font-size: .9375rem; color: var(--ink-2); }
#pdfFrame { width: 100%; flex: 1; min-height: 420px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.pdf-fallback {
  border: 1px dashed var(--line); border-radius: 10px; background: var(--bg-2);
  padding: 28px 22px; text-align: center;
}
.pdf-fallback img { margin-bottom: 14px; }
.pdf-fallback-name { font-weight: 700; color: var(--ink); word-break: break-all; }
.pdf-fallback-hint { color: var(--ink-3); font-size: .875rem; margin-top: 8px; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 12px; padding: 18px 24px; border-top: 1px solid var(--line); background: var(--bg-2); }
.modal-foot .btn { flex: 1 1 200px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
