/* ==========================================================================
   Puels.legal · Consent-Manager UI
   Design-Tokens: Navy/Gold/Cream aus styles.css
   ========================================================================== */

/* ---------- Banner (kompakt, unten links) -------------------------------- */
#pcm-banner {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  width: min(420px, calc(100vw - 2rem));
  max-width: 420px;
  background: var(--bg, #fff);
  border: 1px solid var(--border, #E6E0D2);
  border-radius: 14px;
  box-shadow:
    0 18px 48px -16px rgba(15,17,21,.22),
    0 4px 12px -4px rgba(15,17,21,.08);
  z-index: 2147483000; /* above almost everything */
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  color: var(--ink, #0E1822);
  animation: pcmRise .35s var(--ease, cubic-bezier(.2,.8,.2,1));
  box-sizing: border-box;
}
#pcm-banner *, #pcm-banner *::before, #pcm-banner *::after { box-sizing: border-box; }

#pcm-banner[hidden] { display: none !important; }

#pcm-banner .pcm-banner-inner {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: 1.1rem 1.2rem 1rem;
}

#pcm-banner .pcm-text-compact {
  font-size: .85rem;
  line-height: 1.5;
  margin: 0;
  color: var(--text, #1A2535);
}

#pcm-banner .pcm-link {
  color: var(--navy, #14213D);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  margin-left: .15rem;
}

#pcm-banner .pcm-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

#pcm-banner .pcm-actions .pcm-btn {
  flex: 1 1 auto;
  justify-content: center;
}

#pcm-banner .pcm-btn,
#pcm-modal .pcm-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: .86rem;
  padding: .62rem 1rem;
  border-radius: 100px;
  cursor: pointer;
  transition: background .2s, color .2s, border .2s, transform .15s;
  white-space: nowrap;
  letter-spacing: .01em;
  text-align: center;
}

#pcm-banner .pcm-btn-primary,
#pcm-modal .pcm-btn-primary {
  background: var(--navy, #14213D);
  color: var(--text-on-dark, #F5F2EA);
}
#pcm-banner .pcm-btn-primary:hover,
#pcm-modal .pcm-btn-primary:hover {
  background: var(--navy-hover, #1F3158);
  transform: translateY(-1px);
}

#pcm-banner .pcm-btn-ghost,
#pcm-modal .pcm-btn-ghost {
  background: transparent;
  color: var(--navy, #14213D);
  border-color: var(--border-line, #D2CBB9);
}
#pcm-banner .pcm-btn-ghost:hover,
#pcm-modal .pcm-btn-ghost:hover {
  background: var(--bg-cream, #F8F5EC);
  border-color: var(--gold, #B08856);
}

#pcm-banner .pcm-btn-tertiary {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0 auto 0 0;
  font: inherit;
  font-size: .78rem;
  color: var(--text-muted, #5C6878);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color .2s;
  align-self: flex-start;
}
#pcm-banner .pcm-btn-tertiary:hover { color: var(--navy, #14213D); }

/* ---------- Modal (granular, mittig) ------------------------------------- */
#pcm-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 2147483600;
  animation: pcmFade .25s var(--ease, cubic-bezier(.2,.8,.2,1));
}
#pcm-overlay[hidden] { display: none !important; }

#pcm-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483700;
  padding: 1rem;
  pointer-events: none; /* let the overlay catch outside clicks */
  animation: pcmFade .25s var(--ease, cubic-bezier(.2,.8,.2,1));
}
#pcm-modal[hidden] { display: none !important; }

#pcm-modal .pcm-modal-card {
  position: relative;
  width: min(640px, 100%);
  max-height: min(85vh, 760px);
  overflow-y: auto;
  background: var(--bg, #fff);
  border: 1px solid var(--border, #E6E0D2);
  border-radius: 18px;
  box-shadow: var(--shadow-xl, 0 40px 100px -25px rgba(15,17,21,.25));
  padding: 1.75rem 1.75rem 1.5rem;
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  color: var(--ink, #0E1822);
  pointer-events: auto;  /* card itself is interactive */
  box-sizing: border-box;
}
#pcm-modal .pcm-modal-card *,
#pcm-modal .pcm-modal-card *::before,
#pcm-modal .pcm-modal-card *::after { box-sizing: border-box; }

#pcm-modal .pcm-modal-close {
  position: absolute;
  top: .9rem;
  right: .9rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border, #E6E0D2);
  background: var(--bg, #fff);
  color: var(--text-muted, #5C6878);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s, border .2s;
}
#pcm-modal .pcm-modal-close:hover {
  background: var(--bg-cream, #F8F5EC);
  color: var(--navy, #14213D);
  border-color: var(--gold, #B08856);
}

#pcm-modal h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 .5rem;
  color: var(--navy, #14213D);
  letter-spacing: -.01em;
}

#pcm-modal .pcm-modal-lead {
  font-size: .92rem;
  line-height: 1.55;
  color: var(--text-muted, #5C6878);
  margin: 0 0 1.25rem;
}

#pcm-modal .pcm-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: .85rem;
}

#pcm-modal .pcm-svc {
  border: 1px solid var(--border, #E6E0D2);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: var(--bg-cream, #F8F5EC);
}

#pcm-modal .pcm-svc-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  user-select: none;
}

#pcm-modal .pcm-svc-row input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--gold, #B08856);
  flex: 0 0 auto;
}

#pcm-modal .pcm-svc-title {
  font-weight: 600;
  font-size: .98rem;
  color: var(--navy, #14213D);
}

#pcm-modal .pcm-svc-desc {
  margin: .45rem 0 0 1.9rem;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--text-muted, #5C6878);
}

#pcm-modal .pcm-modal-actions {
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ---------- Inline gates (Calendly / Maps) ------------------------------- */
.consent-gate {
  position: relative;
  display: block;
  width: 100%;
  min-height: 280px;
  border: 1px solid var(--border, #E6E0D2);
  border-radius: 14px;
  background: var(--bg-cream, #F8F5EC);
  padding: 2rem 1.5rem;
  text-align: center;
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  color: var(--text, #1A2535);
}
.consent-gate.is-loaded {
  padding: 0;
  background: transparent;
  border: 0;
  min-height: 0;
}
.consent-gate-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy, #14213D);
  margin: .25rem 0 .5rem;
}
.consent-gate-text {
  font-size: .9rem;
  line-height: 1.55;
  color: var(--text-muted, #5C6878);
  margin: 0 auto 1.25rem;
  max-width: 38rem;
}
.consent-gate-btn {
  appearance: none;
  border: 1px solid var(--navy, #14213D);
  background: var(--navy, #14213D);
  color: var(--text-on-dark, #F5F2EA);
  font: inherit;
  font-weight: 600;
  padding: .7rem 1.4rem;
  border-radius: 100px;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.consent-gate-btn:hover {
  background: var(--navy-hover, #1F3158);
  transform: translateY(-1px);
}
.consent-gate-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg, #fff);
  color: var(--gold, #B08856);
  margin-bottom: .5rem;
  border: 1px solid var(--border, #E6E0D2);
}

/* ---------- Mobile ------------------------------------------------------- */
@media (max-width: 520px) {
  #pcm-banner {
    left: .75rem;
    right: .75rem;
    bottom: .75rem;
    width: auto;
    max-width: none;
  }
}

/* ---------- Animations --------------------------------------------------- */
@keyframes pcmFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pcmRise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  #pcm-banner, #pcm-overlay, #pcm-modal { animation: none; }
}
