/* Banner cookie, setări și bife de confidențialitate. Folosește tokenurile site-ului (--paper, --ink, --brand…). */
:root {
  --cm-paper: var(--paper, #fff);
  --cm-raised: var(--raised, #f9fafb);
  --cm-canvas: var(--canvas, #e5e7eb);
  --cm-line: var(--line-strong, #d1d5dc);
  --cm-ink: var(--ink, #1e2939);
  --cm-ink-muted: var(--ink-muted, #4a5565);
  --cm-ink-faint: var(--ink-faint, #6a7282);
  --cm-brand: var(--brand, #ca3500);
  --cm-brand-strong: var(--brand-strong, #9f2d00);
  --cm-danger: var(--danger, #c10007);
  --cm-radius: 1.25rem;
  --cm-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --cm-font: "Geist Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.cm-lock { overflow: hidden; }

/* ---------- Butoane ---------- */
.cm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 0.9375rem/1 var(--cm-font);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
  white-space: nowrap;
}
.cm-btn:active { transform: scale(0.97); }
.cm-btn:focus-visible,
.cm-modal__close:focus-visible,
.cm-legal button:focus-visible,
.cm-legal a:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--cm-brand) 45%, transparent);
  outline-offset: 2px;
}
.cm-btn--primary { background: var(--cm-brand); color: #fff; }
.cm-btn--primary:hover { background: var(--cm-brand-strong); }
.cm-btn--plain { background: var(--cm-paper); color: var(--cm-ink); border-color: var(--cm-line); }
.cm-btn--plain:hover { border-color: var(--cm-ink-faint); }
.cm-btn--link { background: transparent; color: var(--cm-ink-muted); padding: 0 0.75rem; text-decoration: underline; text-underline-offset: 3px; }
.cm-btn--link:hover { color: var(--cm-ink); }

/* ---------- Banner ---------- */
.cm-banner {
  position: fixed;
  z-index: 2147483000;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem 2rem;
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  background: var(--cm-paper);
  color: var(--cm-ink);
  font-family: var(--cm-font);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / 0.35), 0 2px 6px rgb(0 0 0 / 0.06);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 400ms var(--cm-ease), transform 400ms var(--cm-ease);
}
.cm-banner.is-visible { opacity: 1; transform: none; }
.cm-banner::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.25rem;
  bottom: 1.25rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--cm-brand);
}
.cm-banner__title { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; }
.cm-banner__text { margin: 0; font-size: 0.875rem; line-height: 1.55; color: var(--cm-ink-muted); }
.cm-banner a,
.cm-modal a,
.cm-form-consent a { color: var(--cm-brand); text-decoration: underline; text-underline-offset: 2px; }
.cm-banner__actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

@media (max-width: 760px) {
  .cm-banner { flex-direction: column; align-items: stretch; left: 0.75rem; right: 0.75rem; bottom: 0.75rem; padding: 1.125rem; }
  .cm-banner::before { display: none; }
  .cm-banner__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .cm-banner__actions .cm-btn--link { grid-column: 1 / -1; order: 3; min-height: 2.25rem; }
}

/* ---------- Fereastra de setări ---------- */
.cm-modal { position: fixed; inset: 0; z-index: 2147483001; display: grid; place-items: center; padding: 1rem; font-family: var(--cm-font); }
.cm-modal[hidden] { display: none; }
.cm-modal__backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 0.5); backdrop-filter: blur(4px); animation: cm-fade 200ms ease; }
.cm-modal__panel {
  position: relative;
  width: 100%;
  max-width: 34rem;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: 1.5rem;
  border-radius: 1.5rem;
  background: var(--cm-paper);
  color: var(--cm-ink);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.5);
  animation: cm-rise 300ms var(--cm-ease);
  outline: none;
}
.cm-modal__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cm-modal__title { margin: 0; font-size: 1.375rem; font-weight: 650; letter-spacing: -0.02em; }
.cm-modal__close {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem;
  border: 0; border-radius: 999px; background: var(--cm-raised); color: var(--cm-ink-muted);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.cm-modal__close:hover { background: var(--cm-canvas); color: var(--cm-ink); }
.cm-modal__lead { margin: 0.75rem 0 1.25rem; font-size: 0.9rem; line-height: 1.55; color: var(--cm-ink-muted); }
.cm-cat { padding: 1rem 0; border-top: 1px solid var(--cm-line); }
.cm-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cm-cat__title { font-weight: 600; font-size: 0.975rem; cursor: pointer; }
.cm-cat__text { margin: 0.35rem 0 0; font-size: 0.85rem; line-height: 1.5; color: var(--cm-ink-muted); }
.cm-modal__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; padding-top: 1.25rem; border-top: 1px solid var(--cm-line); }
.cm-modal__foot { margin: 1rem 0 0; font-size: 0.75rem; color: var(--cm-ink-faint); }
@media (max-width: 480px) {
  .cm-modal { align-items: end; padding: 0; }
  .cm-modal__panel { border-radius: 1.5rem 1.5rem 0 0; max-height: 92dvh; }
  .cm-modal__actions .cm-btn { flex: 1 1 100%; }
}

/* Comutator */
.cm-switch { position: relative; display: inline-flex; flex-shrink: 0; }
.cm-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.cm-switch input:disabled { cursor: not-allowed; }
.cm-switch__track {
  width: 2.75rem; height: 1.5rem; border-radius: 999px; background: var(--cm-canvas);
  border: 1px solid var(--cm-line); position: relative; transition: background-color 200ms ease, border-color 200ms ease;
}
.cm-switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 1.125rem; height: 1.125rem; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform 250ms var(--cm-ease);
}
.cm-switch input:checked + .cm-switch__track { background: var(--cm-brand); border-color: var(--cm-brand); }
.cm-switch input:checked + .cm-switch__track::after { transform: translateX(1.25rem); }
.cm-switch input:disabled + .cm-switch__track { opacity: 0.55; }
.cm-switch input:focus-visible + .cm-switch__track { outline: 3px solid color-mix(in oklab, var(--cm-brand) 45%, transparent); outline-offset: 2px; }

/* ---------- Bifa din formulare ---------- */
.cm-form-consent { display: grid; gap: 0.4rem; }
.cm-check { display: flex; gap: 0.75rem; align-items: flex-start; cursor: pointer; font-family: var(--cm-font); }
.cm-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cm-check__box {
  flex-shrink: 0; width: 1.375rem; height: 1.375rem; margin-top: 0.05rem; border-radius: 0.45rem;
  border: 1.5px solid var(--cm-line); background: var(--cm-raised);
  display: grid; place-items: center; transition: background-color 150ms ease, border-color 150ms ease;
}
.cm-check__box::after {
  content: ""; width: 0.4rem; height: 0.7rem; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px) scale(0); transition: transform 200ms var(--cm-ease);
}
.cm-check input:checked + .cm-check__box { background: var(--cm-brand); border-color: var(--cm-brand); }
.cm-check input:checked + .cm-check__box::after { transform: rotate(45deg) translate(-1px, -1px) scale(1); }
.cm-check input:focus-visible + .cm-check__box { outline: 3px solid color-mix(in oklab, var(--cm-brand) 40%, transparent); outline-offset: 2px; }
.cm-check__text { font-size: 0.875rem; line-height: 1.5; color: var(--cm-ink-muted); }
.cm-form-consent__note { margin: 0 0 0 2.125rem; font-size: 0.75rem; color: var(--cm-ink-faint); }
.cm-form-consent.is-error .cm-check__box { border-color: var(--cm-danger); box-shadow: 0 0 0 4px color-mix(in oklab, var(--cm-danger) 15%, transparent); }
.cm-form-consent.is-error .cm-form-consent__note::before { content: "Bifează acordul ca să trimiți cererea. "; color: var(--cm-danger); font-weight: 600; }

/* ---------- Linkuri legale în subsol ---------- */
.cm-legal {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 1.25rem;
  font-family: var(--cm-font); font-size: 0.75rem;
}
/* Pe telefon: copyright, linkurile și „Prețurile nu includ TVA” centrate, unul sub altul. */
@media (max-width: 767px) {
  .cm-legal-row { flex-direction: column; justify-content: center; text-align: center; }
}
.cm-legal a,
.cm-legal button { color: var(--cm-ink-muted); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.cm-legal a:hover,
.cm-legal button:hover { color: var(--cm-brand); text-decoration: underline; text-underline-offset: 3px; }

@keyframes cm-fade { from { opacity: 0; } }
@keyframes cm-rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } }

@media (prefers-reduced-motion: reduce) {
  .cm-banner, .cm-modal__panel, .cm-modal__backdrop, .cm-switch__track::after, .cm-check__box::after { transition: none; animation: none; }
}
