/* src/styles/oq-consent.css */
/*!
 * Opti-Q — Cookie-Consent (Styles)
 * Nutzt die Design-Tokens der Website (--oq-*, --font-*, --radius-*, --shadow-*)
 * mit Fallbacks, damit der Dialog auch ohne geladenes Framework korrekt aussieht.
 */

.oqc-root {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.oqc-root[hidden] { display: none !important; }

.oqc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 24, 29, 0.55);
  backdrop-filter: blur(2px);
  animation: oqc-fade 180ms ease-out;
}

/* Scroll der Seite sperren, solange der Dialog offen ist */
.oqc-locked { overflow: hidden !important; }

.oqc-dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 28px;
  background: var(--surface-card, #fff);
  color: var(--oq-grey-700, hsla(220, 11.11%, 26.47%, 1));
  font-family: var(--font-body, "Open Sans", system-ui, sans-serif);
  font-size: 0.9375rem;
  line-height: var(--leading-normal, 1.5);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-xl, 0 24px 56px rgba(22, 24, 29, 0.16));
  animation: oqc-rise 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.oqc-title {
  margin: 0 0 10px;
  font-family: var(--font-display, "Nunito", system-ui, sans-serif);
  font-size: 1.3125rem;
  font-weight: 800;
  line-height: var(--leading-tight, 1.15);
  color: var(--oq-purple-700, hsla(280.91, 57.89%, 22.35%, 1));
}

.oqc-desc { margin: 0 0 18px; }

/* ---------- Kategorien ---------- */
.oqc-cats {
  margin: 0 0 20px;
  border-top: 1px solid var(--oq-grey-200, hsla(217.5, 14.29%, 89.02%, 1));
}
.oqc-cats[hidden] { display: none; }

.oqc-cat {
  padding: 14px 0;
  border-bottom: 1px solid var(--oq-grey-200, hsla(217.5, 14.29%, 89.02%, 1));
}

.oqc-cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.oqc-check {
  flex: none;
  width: 18px;
  height: 18px;
  accent-color: var(--oq-purple, hsla(281.68, 56.89%, 32.75%, 1));
  cursor: pointer;
}
.oqc-check:disabled { cursor: default; opacity: 0.65; }
.oqc-check:focus-visible {
  outline: 2px solid var(--oq-purple-400, hsla(279.33, 37.82%, 46.67%, 1));
  outline-offset: 2px;
}

.oqc-cat-name {
  font-weight: 700;
  color: var(--oq-grey-900, hsla(222.86, 13.73%, 10%, 1));
}

.oqc-badge {
  margin-left: auto;
  padding: 2px 9px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--oq-grey-600, hsla(216.67, 9.68%, 36.47%, 1));
  background: var(--oq-grey-100, hsla(216, 15.15%, 93.53%, 1));
  border-radius: var(--radius-pill, 999px);
}

.oqc-cat-desc {
  margin: 6px 0 0 28px;
  font-size: 0.8125rem;
  color: var(--oq-grey-600, hsla(216.67, 9.68%, 36.47%, 1));
}

.oqc-legal {
  margin: 14px 0 0;
  font-size: 0.75rem;
  color: var(--oq-grey-500, hsla(216, 8.26%, 47.45%, 1));
}

/* ---------- Aktionen ----------
   Ablehnen und Akzeptieren sind bewusst gleich gross, gleich schwer und
   gleich prominent — Voraussetzung fuer eine wirksame Einwilligung. */
.oqc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.oqc-btn {
  flex: 1 1 0;
  min-width: 140px;
  min-height: 46px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  border: 2px solid transparent;
  border-radius: var(--radius-pill, 999px);
  cursor: pointer;
  transition: background-color var(--duration-fast, 120ms) var(--ease-standard, ease),
              border-color var(--duration-fast, 120ms) var(--ease-standard, ease),
              color var(--duration-fast, 120ms) var(--ease-standard, ease);
}
.oqc-btn[hidden] { display: none; }
.oqc-btn:focus-visible {
  outline: 3px solid var(--oq-purple-300, hsla(280, 41.58%, 60.39%, 1));
  outline-offset: 2px;
}

.oqc-btn-neutral {
  color: var(--oq-grey-800, hsla(218.18, 12.64%, 17.06%, 1));
  background: var(--oq-white, #fff);
  border-color: var(--oq-grey-400, hsla(217.89, 10.38%, 64.12%, 1));
}
.oqc-btn-neutral:hover {
  background: var(--oq-grey-100, hsla(216, 15.15%, 93.53%, 1));
  border-color: var(--oq-grey-500, hsla(216, 8.26%, 47.45%, 1));
}

.oqc-btn-accent {
  color: #fff;
  background: var(--oq-purple, hsla(281.68, 56.89%, 32.75%, 1));
  border-color: var(--oq-purple, hsla(281.68, 56.89%, 32.75%, 1));
}
.oqc-btn-accent:hover {
  background: var(--oq-purple-600, hsla(281.71, 57.75%, 27.84%, 1));
  border-color: var(--oq-purple-600, hsla(281.71, 57.75%, 27.84%, 1));
}

/* ---------- Fusslinks ---------- */
.oqc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 16px;
  font-size: 0.8125rem;
}
.oqc-links a,
.oqc-linkbtn {
  color: var(--oq-purple, hsla(281.68, 56.89%, 32.75%, 1));
  text-decoration: underline;
  text-underline-offset: 2px;
}
.oqc-linkbtn {
  padding: 0;
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.oqc-links a:hover,
.oqc-linkbtn:hover { color: var(--oq-purple-700, hsla(280.91, 57.89%, 22.35%, 1)); }
.oqc-links a:focus-visible,
.oqc-linkbtn:focus-visible {
  outline: 2px solid var(--oq-purple-400, hsla(279.33, 37.82%, 46.67%, 1));
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Wiederaufruf-Button ---------- */
.oqc-fab {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 2147482000;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 15px;
  font-family: var(--font-body, "Open Sans", system-ui, sans-serif);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--oq-purple-700, hsla(280.91, 57.89%, 22.35%, 1));
  background: var(--oq-white, #fff);
  border: 1px solid var(--oq-grey-300, hsla(216.92, 12.87%, 80.2%, 1));
  border-radius: var(--radius-pill, 999px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(22, 24, 29, 0.08));
  cursor: pointer;
  transition: background-color var(--duration-fast, 120ms) var(--ease-standard, ease);
}
.oqc-fab[hidden] { display: none !important; }
.oqc-fab:hover { background: var(--oq-purple-50, hsla(280, 36%, 95.1%, 1)); }
.oqc-fab:focus-visible {
  outline: 3px solid var(--oq-purple-300, hsla(280, 41.58%, 60.39%, 1));
  outline-offset: 2px;
}

/* ---------- Platzhalter fuer blockierte Einbettungen ---------- */
[data-oq-placeholder] {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 24px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--oq-grey-600, hsla(216.67, 9.68%, 36.47%, 1));
  background: var(--oq-grey-50, hsla(220, 17.65%, 96.67%, 1));
  border: 1px dashed var(--oq-grey-300, hsla(216.92, 12.87%, 80.2%, 1));
  border-radius: var(--radius-md, 10px);
}

/* ---------- Mobil: Bottom-Sheet ---------- */
@media (max-width: 560px) {
  .oqc-root { padding: 0; align-items: flex-end; }
  .oqc-dialog {
    max-width: none;
    max-height: 88vh;
    padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--radius-lg, 16px) var(--radius-lg, 16px) 0 0;
    animation: oqc-sheet 240ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  .oqc-btn { flex-basis: 100%; }
  .oqc-fab { left: 12px; bottom: 12px; }
}

/* ---------- Bewegung / Kontrast ---------- */
@keyframes oqc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes oqc-rise { from { opacity: 0; transform: translateY(12px) scale(0.98); }
                      to   { opacity: 1; transform: none; } }
@keyframes oqc-sheet { from { transform: translateY(100%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .oqc-backdrop, .oqc-dialog { animation: none; }
  .oqc-btn, .oqc-fab { transition: none; }
}

@media (forced-colors: active) {
  .oqc-dialog { border: 1px solid CanvasText; }
  .oqc-btn { border-color: CanvasText; }
}
