/* mainwerk · Cookie Consent · Styling */

:root {
  --cc-primary: #10B981;
  --cc-primary-hover: #059669;
  --cc-text: #0F172A;
  --cc-muted: #64748B;
  --cc-border: #E2E8F0;
  --cc-bg: #FFFFFF;
  --cc-bg-soft: #F8FAFC;
  --cc-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.25);
  --cc-radius: 16px;
  --cc-radius-sm: 10px;
}

[x-cloak] { display: none !important; }

.cc-banner,
.cc-modal-backdrop,
.cc-reopen {
  font-family: 'Geist Variable', 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--cc-text);
  -webkit-font-smoothing: antialiased;
}

/* ─────────────  Banner (Layer 1)  ───────────── */
.cc-banner {
  position: fixed;
  z-index: 2147483600;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 40rem;
  margin: 0 auto;
  background: var(--cc-bg);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  padding: 1.5rem;
  animation: cc-slide-up .35s cubic-bezier(.22,.61,.36,1);
}
@keyframes cc-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.cc-banner__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.cc-banner__title svg { color: var(--cc-primary); flex-shrink: 0; }
.cc-banner__text {
  font-size: .9375rem;
  line-height: 1.55;
  color: var(--cc-muted);
  margin: 0 0 1.25rem;
}
.cc-banner__text a {
  color: var(--cc-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cc-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

/* ─────────────  Buttons  ───────────── */
.cc-btn {
  font: inherit;
  font-weight: 500;
  font-size: .9375rem;
  line-height: 1;
  padding: .75rem 1.125rem;
  border-radius: var(--cc-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .05s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  text-decoration: none;
}
.cc-btn:active { transform: translateY(1px); }
.cc-btn:focus-visible {
  outline: 2px solid var(--cc-primary);
  outline-offset: 2px;
}
.cc-btn--primary {
  background: var(--cc-primary);
  color: #fff;
}
.cc-btn--primary:hover { background: var(--cc-primary-hover); }
.cc-btn--secondary {
  background: var(--cc-bg);
  color: var(--cc-text);
  border-color: var(--cc-border);
}
.cc-btn--secondary:hover { background: var(--cc-bg-soft); }
.cc-btn--ghost {
  background: transparent;
  color: var(--cc-muted);
  padding-left: .75rem;
  padding-right: .75rem;
}
.cc-btn--ghost:hover { color: var(--cc-text); }
.cc-btn--block { flex: 1 1 auto; }

/* ─────────────  Modal (Layer 2)  ───────────── */
.cc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483601;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: cc-fade-in .2s ease;
}
@keyframes cc-fade-in { from { opacity: 0; } to { opacity: 1; } }

.cc-modal {
  background: var(--cc-bg);
  border-radius: var(--cc-radius);
  width: 100%;
  max-width: 34rem;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--cc-shadow);
  animation: cc-scale-in .25s cubic-bezier(.22,.61,.36,1);
}
@keyframes cc-scale-in {
  from { transform: scale(.96); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.cc-modal__header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--cc-border);
}
.cc-modal__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 .375rem;
}
.cc-modal__subtitle {
  font-size: .9375rem;
  color: var(--cc-muted);
  margin: 0;
  line-height: 1.55;
}
.cc-modal__body {
  padding: .5rem 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
}
.cc-modal__footer {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--cc-border);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  background: var(--cc-bg-soft);
}

/* ─────────────  Category Card  ───────────── */
.cc-category {
  padding: 1rem 0;
  border-bottom: 1px solid var(--cc-border);
}
.cc-category:last-child { border-bottom: none; }
.cc-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .375rem;
}
.cc-category__name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}
.cc-category__desc {
  font-size: .875rem;
  color: var(--cc-muted);
  line-height: 1.55;
  margin: 0;
}
.cc-category__locked {
  font-size: .75rem;
  font-weight: 500;
  color: var(--cc-primary);
  background: rgba(16, 185, 129, .1);
  padding: .25rem .5rem;
  border-radius: 999px;
  letter-spacing: .02em;
}

/* ─────────────  Toggle Switch  ───────────── */
.cc-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.cc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.cc-toggle__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #CBD5E1;
  border-radius: 999px;
  transition: background-color .2s;
}
.cc-toggle__slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.cc-toggle input:checked + .cc-toggle__slider { background: var(--cc-primary); }
.cc-toggle input:checked + .cc-toggle__slider::before { transform: translateX(20px); }
.cc-toggle input:disabled + .cc-toggle__slider { cursor: not-allowed; opacity: .65; }
.cc-toggle input:focus-visible + .cc-toggle__slider {
  outline: 2px solid var(--cc-primary);
  outline-offset: 2px;
}

/* ─────────────  Re-open Floating Button  ───────────── */
.cc-reopen {
  position: fixed;
  z-index: 2147483599;
  left: 1rem;
  bottom: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cc-bg);
  border: 1px solid var(--cc-border);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cc-muted);
  cursor: pointer;
  transition: color .15s, transform .15s, box-shadow .15s;
}
.cc-reopen:hover {
  color: var(--cc-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .15);
}
.cc-reopen:focus-visible {
  outline: 2px solid var(--cc-primary);
  outline-offset: 2px;
}

/* ─────────────  Mobile  ───────────── */
@media (max-width: 640px) {
  .cc-banner {
    left: .5rem;
    right: .5rem;
    bottom: .5rem;
    padding: 1.25rem;
    border-radius: 14px;
  }
  .cc-banner__actions { flex-direction: column; }
  .cc-banner__actions .cc-btn { width: 100%; }
  .cc-modal__footer { flex-direction: column; }
  .cc-modal__footer .cc-btn { width: 100%; }
  .cc-reopen { left: .5rem; bottom: .5rem; }
}

/* ─────────────  Dark mode (optional)  ───────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --cc-text: #F1F5F9;
    --cc-muted: #94A3B8;
    --cc-border: #1E293B;
    --cc-bg: #0F172A;
    --cc-bg-soft: #1E293B;
  }
  .cc-toggle__slider { background: #334155; }
}
