/* ===========================================================================
 * LEVIAPAY — Klaro consent manager styling
 * ---------------------------------------------------------------------------
 * Klaro is loaded via the *no-css* build, so ALL styling lives here.
 * This stylesheet ports Henrik's standalone mock 1:1: a square, pure-black
 * card with a 2px white border and a full-width segmented button bar
 * (Einstellungen | Alle ablehnen | Alle akzeptieren), monochrome.
 *
 * EQUAL PROMINENCE: "Alle ablehnen" and "Alle akzeptieren" share an identical
 * treatment — same white fill / black text / weight / width — so neither is
 * emphasised (German DPA requirement). "Einstellungen" is the secondary
 * settings segment (black, underlined).
 *
 * Klaro notice DOM:
 *   .cookie-notice > .cn-body > [ p#id-cookie-notice , .cn-ok ]
 *   .cn-ok > [ a.cn-learn-more , .cn-buttons > [ .cn-decline , .cm-btn-success ] ]
 * =========================================================================== */

.klaro {
  --k-black: #000;
  --k-white: #fff;
  --k-text: #e6e6e6;
  --k-line: #fff; /* borders / dividers */
  --k-hair: 2px;
  --k-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-family: var(--k-font);
}

.klaro *,
.klaro *::before,
.klaro *::after {
  box-sizing: border-box;
}

.klaro button {
  font-family: var(--k-font);
  -webkit-appearance: none;
  appearance: none;
}

/* Powered-by hidden (disablePoweredBy also set in config) */
.klaro .cm-powered-by {
  display: none !important;
}

/* Klaro auto-focuses the notice/modal container — suppress the browser focus
 * ring on the containers (keep it on actual buttons for a11y). */
.klaro .cookie-notice:focus,
.klaro .cookie-modal:focus,
.klaro .cm-modal:focus,
.klaro .cn-body:focus {
  outline: none;
}

/* ════════════════════════════════════════════════════════════════════════
 *  Consent notice — square black card, 2px white border, segmented bar
 * ════════════════════════════════════════════════════════════════════════ */
.klaro .cookie-notice:not(.cookie-modal-notice) {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 880px;
  margin: 0 auto;
  z-index: 10000;
  background: var(--k-black);
  color: var(--k-text);
  border: var(--k-hair) solid var(--k-line);
  border-radius: 0;
  padding: 0;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.klaro .cookie-notice .cn-body {
  margin: 0;
  padding: 0;
  display: block;
}

/* Text block */
.klaro .cookie-notice .cn-body > p {
  margin: 0;
  padding: 36px 40px 32px;
  color: var(--k-text);
  font-size: 17px;
  line-height: 1.6;
}

.klaro .cookie-notice .cn-body > p a,
.klaro .cookie-notice .cm-link {
  color: var(--k-white);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* The button bar (.cn-ok) — full width, top hairline, three flush segments */
.klaro .cookie-notice .cn-ok {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 0;
  border-top: var(--k-hair) solid var(--k-line);
}

.klaro .cookie-notice .cn-buttons {
  display: flex;
  align-items: stretch;
  flex: 2 1 0;
  margin: 0;
  padding: 0;
  gap: 0;
}

/* Every segment shares geometry */
.klaro .cookie-notice .cn-learn-more,
.klaro .cookie-notice .cn-ok .cm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 20px 24px;
  border: 0;
  border-radius: 0;
  font-family: var(--k-font);
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Segment 1 — "Einstellungen" (learn-more): black, white, underlined */
.klaro .cookie-notice .cn-learn-more {
  flex: 1 1 0;
  background: var(--k-black);
  color: var(--k-white);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  border-right: var(--k-hair) solid var(--k-line);
}
.klaro .cookie-notice .cn-learn-more:hover {
  background: #1a1a1a;
}

/* Segments 2 & 3 — "Alle ablehnen" + "Alle akzeptieren": IDENTICAL.
 * Same white fill / black text / weight / width = equal prominence.
 * A grey hairline divides the two white segments (a white divider would
 * be invisible between them); the divider before them rides the black→white
 * edge so it reads cleanly. */
.klaro .cookie-notice .cn-decline,
.klaro .cookie-notice .cm-btn-danger,
.klaro .cookie-notice .cm-btn-success {
  flex: 1 1 0;
  background: var(--k-white);
  color: var(--k-black);
  font-weight: 700;
}
.klaro .cookie-notice .cn-decline,
.klaro .cookie-notice .cm-btn-danger {
  border-right: var(--k-hair) solid #cfcfcf;
}
.klaro .cookie-notice .cn-decline:hover,
.klaro .cookie-notice .cm-btn-danger:hover,
.klaro .cookie-notice .cm-btn-success:hover {
  background: #e8e8e8;
}

/* ════════════════════════════════════════════════════════════════════════
 *  Settings modal — same dark/square/white-border language as the banner
 * ════════════════════════════════════════════════════════════════════════ */
.klaro .cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.klaro .cookie-modal .cm-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.klaro .cookie-modal .cm-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--k-black);
  color: var(--k-text);
  border: var(--k-hair) solid var(--k-line);
  border-radius: 0;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.klaro .cm-modal .cm-header {
  padding: 32px 40px 20px;
  border-bottom: var(--k-hair) solid var(--k-line);
}
.klaro .cm-modal .cm-header h1,
.klaro .cm-modal .cm-header .title {
  margin: 0 0 12px;
  color: var(--k-white);
  font-size: 22px;
  font-weight: 700;
}
.klaro .cm-modal .cm-header p {
  margin: 0;
  color: var(--k-text);
  font-size: 15px;
  line-height: 1.6;
}
.klaro .cm-modal .hide {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--k-text);
}
.klaro .cm-modal .hide:hover {
  color: var(--k-white);
}

.klaro .cm-modal .cm-body {
  padding: 8px 40px;
  overflow-y: auto;
}
.klaro .cm-modal .cm-body ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.klaro .cm-modal .cm-purpose,
.klaro .cm-modal .cm-service {
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.klaro .cm-modal li:last-child .cm-purpose,
.klaro .cm-modal li:last-child .cm-service {
  border-bottom: 0;
}
.klaro .cm-modal .cm-list-title {
  color: var(--k-white);
  font-weight: 600;
  font-size: 16px;
}
.klaro .cm-modal .cm-list-description {
  color: var(--k-text);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 6px;
}
.klaro .cm-modal a,
.klaro .cm-modal .cm-link {
  color: var(--k-white);
  text-decoration: underline;
}

/* Category checkbox — squared, 22px, monochrome (matches the mock).
 * Klaro ships a native checkbox + a slider switch; we hide the slider and
 * style the native checkbox directly: off = black box / white border,
 * on = white box with a black ✓. */
.klaro .cm-switch {
  display: none;
}
.klaro .cm-list-label {
  display: inline;
  vertical-align: middle;
}
.klaro .cm-list-input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0 12px 0 0;
  vertical-align: middle;
  background: var(--k-black);
  border: 2px solid var(--k-white);
  border-radius: 0;
  cursor: pointer;
  position: relative;
  display: inline-block;
}
.klaro .cm-list-input[type="checkbox"]:checked {
  background: var(--k-white);
}
.klaro .cm-list-input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--k-black);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}
/* Required ("immer aktiv") boxes — locked on, full white + ✓ (per mock) */
.klaro .cm-list-input[type="checkbox"].required,
.klaro .cm-list-input[type="checkbox"]:disabled {
  cursor: default;
}
/* Keep the title on the same line as its box */
.klaro .cm-modal .cm-list-title {
  vertical-align: middle;
}

/* Service expander ("↓ N Dienst") — collapsed by default; the caret toggles
 * the .expanded class. The no-css build ships no show/hide rule, so without
 * this the list is always visible and the arrow does nothing. */
.klaro .cm-modal .cm-services .cm-content {
  display: none;
  margin-top: 12px;
  padding-left: 4px;
}
.klaro .cm-modal .cm-services .cm-content.expanded {
  display: block;
}
.klaro .cm-modal .cm-caret a {
  display: inline-block;
  margin-top: 8px;
  color: var(--k-white);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.klaro .cm-modal .cm-caret a span {
  display: inline-block;
  transition: transform 0.15s ease;
}
.klaro .cm-modal .cm-caret a[aria-expanded="true"] span {
  transform: rotate(180deg);
}

/* Modal footer — segmented buttons in the banner's language */
.klaro .cm-modal .cm-footer {
  padding: 0;
  border-top: var(--k-hair) solid var(--k-line);
}
.klaro .cm-modal .cm-footer-buttons {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.klaro .cm-modal .cm-footer .cm-btn {
  flex: 1 1 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  border: 0;
  border-right: var(--k-hair) solid var(--k-line);
  border-radius: 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--k-black);
  color: var(--k-white);
  transition: background-color 0.15s ease;
}
.klaro .cm-modal .cm-footer .cm-btn:last-child {
  border-right: 0;
}
.klaro .cm-modal .cm-footer .cm-btn:hover {
  background: #1a1a1a;
}
.klaro .cm-modal .cm-footer .cm-btn.cm-btn-success,
.klaro .cm-modal .cm-footer .cm-btn.cm-btn-accept-all,
.klaro .cm-modal .cm-footer .cm-btn.cm-btn-decline,
.klaro .cm-modal .cm-footer .cm-btn.cm-btn-danger {
  background: var(--k-white);
  color: var(--k-black);
  font-weight: 700;
}
.klaro .cm-modal .cm-footer .cm-btn.cm-btn-success:hover,
.klaro .cm-modal .cm-footer .cm-btn.cm-btn-accept-all:hover,
.klaro .cm-modal .cm-footer .cm-btn.cm-btn-decline:hover,
.klaro .cm-modal .cm-footer .cm-btn.cm-btn-danger:hover {
  background: #e8e8e8;
}

/* ════════════════════════════════════════════════════════════════════════
 *  Responsive — stack the segmented bar vertically on narrow screens
 * ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .klaro .cookie-notice:not(.cookie-modal-notice) {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .klaro .cookie-notice .cn-body > p {
    padding: 24px 24px 20px;
    font-size: 15px;
  }
  .klaro .cookie-notice .cn-ok,
  .klaro .cookie-notice .cn-buttons {
    flex-direction: column;
  }
  .klaro .cookie-notice .cn-learn-more,
  .klaro .cookie-notice .cn-decline,
  .klaro .cookie-notice .cm-btn-danger {
    border-right: 0;
    border-bottom: var(--k-hair) solid var(--k-line);
  }
  .klaro .cm-modal .cm-footer-buttons {
    flex-direction: column;
  }
  .klaro .cm-modal .cm-footer .cm-btn {
    border-right: 0;
    border-bottom: var(--k-hair) solid var(--k-line);
  }
  .klaro .cm-modal .cm-footer .cm-btn:last-child {
    border-bottom: 0;
  }
}
