/* Cookie-/Einwilligungsbanner — Agentic KMU */

.consent-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

.consent-root[hidden] {
  display: none !important;
}

.consent-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.consent-root.is-visible .consent-backdrop {
  opacity: 1;
}

.consent-panel {
  position: absolute;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  width: min(40rem, calc(100% - 1.5rem));
  max-height: min(90vh, 36rem);
  overflow: auto;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  padding: 1.25rem 1.25rem 1.1rem;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.consent-root.is-visible .consent-panel {
  opacity: 1;
  transform: translate(-50%, 0);
}

.consent-title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: #0f172a;
}

.consent-text {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #475569;
}

.consent-text a {
  color: #ad3e13;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.consent-btn {
  appearance: none;
  border: 0;
  border-radius: 9999px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.consent-btn:focus-visible {
  outline: 2px solid #df5b22;
  outline-offset: 2px;
}

.consent-btn--primary {
  background: #df5b22;
  color: #fff;
}

.consent-btn--primary:hover {
  background: #ad3e13;
}

.consent-btn--secondary {
  background: #fff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.consent-btn--secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.consent-categories {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.consent-category {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.8rem 0.9rem;
  background: #f8fafc;
}

.consent-category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.consent-category-label {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  color: #0f172a;
}

.consent-category-desc {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #64748b;
}

.consent-switch {
  position: relative;
  flex: 0 0 auto;
  width: 2.6rem;
  height: 1.45rem;
  margin-top: 0.1rem;
}

.consent-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.consent-switch input:disabled {
  cursor: not-allowed;
}

.consent-switch-ui {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background: #cbd5e1;
  transition: background-color 0.15s ease;
  pointer-events: none;
}

.consent-switch-ui::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
  transition: transform 0.15s ease;
}

.consent-switch input:checked + .consent-switch-ui {
  background: #df5b22;
}

.consent-switch input:checked + .consent-switch-ui::after {
  transform: translateX(1.15rem);
}

.consent-switch input:disabled + .consent-switch-ui {
  background: #94a3b8;
}

.consent-switch input:focus-visible + .consent-switch-ui {
  outline: 2px solid #df5b22;
  outline-offset: 2px;
}

.consent-edit-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.consent-edit[hidden],
.consent-simple[hidden] {
  display: none !important;
}

button.consent-reopen,
a.consent-reopen {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

button.consent-reopen:hover,
a.consent-reopen:hover {
  text-decoration: underline;
}

@media (min-width: 640px) {
  .consent-panel {
    padding: 1.4rem 1.45rem 1.25rem;
  }

  .consent-actions {
    flex-direction: row;
  }

  .consent-actions .consent-btn {
    flex: 1;
  }

  .consent-btn--primary {
    order: 2;
  }

  .consent-btn--secondary {
    order: 1;
  }

  .consent-edit-actions {
    flex-direction: row;
  }

  .consent-edit-actions .consent-btn {
    flex: 1;
  }
}
