/* CIV Cookie Manager v1.1 — Banner GDPR granular cu Consent Mode v2 */

/* ── Banner wrapper ── */
.civ-cc-banner {
  position: fixed;
  z-index: 99999;
  max-width: 540px;
  width: calc(100% - 32px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(5,43,95,.22), 0 2px 8px rgba(5,43,95,.08);
  border: 1px solid #e2e8f0;
  border-left: 5px solid var(--civ-accent, #0A4DA3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}

/* Poziții */
.civ-cc-pos-bottom { bottom: 20px; left: 20px; transform: translateY(16px); }
.civ-cc-pos-top    { top: 20px;    left: 20px; transform: translateY(-16px); }
.civ-cc-pos-modal  {
  top: 50%; left: 50%;
  transform: translate(-50%, -44%);
  max-width: 560px;
}

.civ-cc-banner.civ-cc-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) !important;
}
.civ-cc-pos-modal.civ-cc-visible { transform: translate(-50%, -50%) !important; }

/* Overlay modal */
.civ-cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(5,43,95,.48);
  animation: civCCfade .25s ease forwards;
}
@keyframes civCCfade { from { opacity:0; } to { opacity:1; } }

/* ── Interior ── */
.civ-cc-inner {
  padding: 22px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.civ-cc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.civ-cc-title {
  font-size: 16px;
  font-weight: 800;
  color: #052B5F;
  line-height: 1.2;
}

.civ-cc-close {
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: #64748B;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.civ-cc-close:hover       { background: #f1f5f9; color: #0A4DA3; }
.civ-cc-close:focus-visible { outline: 2px solid var(--civ-accent,#0A4DA3); outline-offset:2px; }

.civ-cc-intro {
  margin: 0;
  font-size: 14px;
  color: #475569;
  line-height: 1.55;
}

/* ── Categorii ── */
.civ-cc-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  animation: civCCslide .22s ease;
}
@keyframes civCCslide { from { opacity:0; transform: translateY(-6px); } to { opacity:1; transform:none; } }

.civ-cc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e8eef7;
}

.civ-cc-row-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.civ-cc-row-info strong { font-size: 13px; font-weight: 700; color: #1e293b; }
.civ-cc-row-info span   { font-size: 12px; color: #64748b; line-height: 1.4; }

.civ-cc-always {
  font-size: 11px; font-weight: 700; color: #16a34a;
  white-space: nowrap; background: #dcfce7;
  padding: 3px 8px; border-radius: 999px;
}

/* Toggle switch */
.civ-cc-toggle {
  position: relative; display: inline-block;
  width: 42px; height: 24px; flex-shrink: 0; cursor: pointer;
}
.civ-cc-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.civ-cc-slider {
  position: absolute; inset: 0;
  border-radius: 999px; background: #cbd5e1;
  transition: background .2s;
}
.civ-cc-slider:before {
  content: '';
  position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: transform .2s;
}
.civ-cc-toggle input:checked + .civ-cc-slider { background: var(--civ-accent,#0A4DA3); }
.civ-cc-toggle input:checked + .civ-cc-slider:before { transform: translateX(18px); }
.civ-cc-toggle input:focus-visible + .civ-cc-slider {
  box-shadow: 0 0 0 3px rgba(10,77,163,.3);
}

/* ── Butoane ── */
.civ-cc-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
}

.civ-cc-save-row {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; padding-top: 8px;
}

.civ-cc-btn {
  padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; border: 2px solid transparent;
  transition: background .18s, color .18s, border-color .18s;
  line-height: 1; white-space: nowrap;
}
.civ-cc-btn:focus-visible { outline: 2px solid var(--civ-accent,#0A4DA3); outline-offset: 2px; }

.civ-cc-btn-primary {
  background: var(--civ-accent,#0A4DA3);
  color: #fff; border-color: var(--civ-accent,#0A4DA3);
}
.civ-cc-btn-primary:hover { filter: brightness(1.1); }

.civ-cc-btn-secondary {
  background: #f1f5f9; color: #052B5F; border-color: #e2e8f0;
}
.civ-cc-btn-secondary:hover { background: #e2e8f0; }

.civ-cc-btn-outline {
  background: transparent;
  color: var(--civ-accent,#0A4DA3);
  border-color: var(--civ-accent,#0A4DA3);
}
.civ-cc-btn-outline:hover { background: #eff6ff; }

.civ-cc-saved-msg { font-size: 13px; color: #16a34a; font-weight: 600; }

/* ── Linkuri legale ── */
.civ-cc-legal {
  font-size: 11px; color: #94a3b8; line-height: 1.6;
  border-top: 1px solid #f1f5f9; padding-top: 10px;
}
.civ-cc-legal a {
  color: var(--civ-accent,#0A4DA3);
  text-decoration: underline; text-underline-offset: 2px;
}
.civ-cc-legal a:hover { opacity: .8; }

/* ── Toast notificare ── */
.civ-cc-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(12px);
  z-index: 99999; background: #052B5F; color: #fff;
  padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(5,43,95,.3);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  white-space: nowrap;
}
.civ-cc-toast.civ-cc-toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Ad placeholder (când advertising e refuzat) ── */
.civ-ad-placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 90px; border-radius: 12px;
  background: #f8fafc; border: 2px dashed #e2e8f0;
  color: #94a3b8; font-size: 12px; text-align: center;
}

/* ── Buton re-deschidere în footer ── */
.civ-cookie-reopen-btn {
  display: inline-block; padding: 7px 14px;
  background: transparent; color: #dbeafe !important;
  border: 1px solid rgba(219,234,254,.35); border-radius: 999px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .18s, color .18s;
}
.civ-cookie-reopen-btn:hover { background: rgba(219,234,254,.12); color: #fff !important; }
.civ-cookie-reopen-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .civ-cc-banner {
    left: 10px; right: 10px; width: auto; max-width: none;
    border-radius: 14px;
  }
  .civ-cc-pos-bottom { bottom: 10px; }
  .civ-cc-pos-top    { top: 10px; }
  .civ-cc-pos-modal  {
    top: auto; left: 10px; right: 10px; bottom: 10px;
    transform: translateY(16px) !important;
  }
  .civ-cc-pos-modal.civ-cc-visible { transform: translateY(0) !important; }
  .civ-cc-actions { flex-direction: column; }
  .civ-cc-btn { text-align: center; }
  .civ-cc-toast { white-space: normal; max-width: calc(100% - 32px); text-align: center; }
}

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
  .civ-cc-banner {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: 0 20px 60px rgba(0,0,0,.55);
  }
  .civ-cc-title       { color: #e2e8f0; }
  .civ-cc-intro       { color: #94a3b8; }
  .civ-cc-row         { background: #1e293b; border-color: #334155; }
  .civ-cc-row-info strong { color: #e2e8f0; }
  .civ-cc-row-info span   { color: #94a3b8; }
  .civ-cc-legal       { color: #475569; border-color: #1e293b; }
  .civ-cc-btn-secondary { background: #1e293b; color: #e2e8f0; border-color: #334155; }
  .civ-cc-btn-secondary:hover { background: #334155; }
  .civ-cc-close       { color: #64748b; }
  .civ-cc-close:hover { background: #1e293b; }
  .civ-cc-details     { border-color: #334155; }
}
