/* ═══════════════════════════════════════════════
   DocBot Cookie Consent
   ═══════════════════════════════════════════════ */

.consent-banner,
.consent-modal-overlay {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--navy);
  box-sizing: border-box;
}

/* ─── Banner ──────────────────────────────────── */
.consent-banner {
  position: fixed;
  z-index: 9998;
  left: 24px;
  right: 24px;
  bottom: 24px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  background: #ffffff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.04);
  padding: 24px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
.consent-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.consent-banner__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 8px;
  line-height: 1.4;
}
.consent-banner__text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--blue-grey);
  margin: 0 0 20px;
}
.consent-banner__text a {
  color: var(--accent);
  text-decoration: underline;
}
.consent-banner__text a:hover {
  text-decoration: none;
}
.consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ─── Buttons ─────────────────────────────────── */
.consent-btn {
  flex: 1 1 auto;
  min-width: 120px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  line-height: 1.3;
  text-align: center;
}
.consent-btn:active {
  transform: scale(0.98);
}
.consent-btn--primary {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}
.consent-btn--primary:hover {
  background: #1e293b;
}
.consent-btn--secondary {
  background: #ffffff;
  color: var(--navy);
  border-color: var(--border, #e5e7eb);
}
.consent-btn--secondary:hover {
  border-color: var(--navy);
  background: #f8fafc;
}
.consent-btn--ghost {
  background: transparent;
  color: var(--blue-grey);
  border-color: transparent;
  flex: 0 1 auto;
  min-width: 0;
  padding: 10px 12px;
}
.consent-btn--ghost:hover {
  color: var(--navy);
}

/* ─── Modal ───────────────────────────────────── */
.consent-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.consent-modal-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.consent-modal {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.consent-modal-overlay.is-visible .consent-modal {
  transform: translateY(0) scale(1);
}
.consent-modal__header {
  padding: 24px 24px 0;
}
.consent-modal__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 8px;
  line-height: 1.3;
}
.consent-modal__subtitle {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--blue-grey);
  margin: 0 0 8px;
}
.consent-modal__body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.consent-modal__footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border, #e5e7eb);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #fafbfc;
}

/* ─── Category rows ───────────────────────────── */
.consent-category {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.consent-category:last-child {
  border-bottom: none;
}
.consent-category__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.consent-category__name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 4px;
}
.consent-category__desc {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--blue-grey);
  margin: 0;
}

/* ─── Toggle switch ───────────────────────────── */
.consent-toggle {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  display: inline-block;
}
.consent-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.consent-toggle__slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.2s ease;
  cursor: pointer;
}
.consent-toggle__slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}
.consent-toggle input:checked + .consent-toggle__slider {
  background: var(--accent);
}
.consent-toggle input:checked + .consent-toggle__slider::before {
  transform: translateX(16px);
}
.consent-toggle input:disabled + .consent-toggle__slider {
  background: var(--navy);
  opacity: 0.4;
  cursor: not-allowed;
}
.consent-toggle input:focus-visible + .consent-toggle__slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
  .consent-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 20px;
    border-radius: 14px;
  }
  .consent-banner__actions {
    flex-direction: column;
  }
  .consent-btn {
    width: 100%;
    flex: 1 1 auto;
  }
  .consent-modal {
    max-height: calc(100vh - 24px);
  }
  .consent-modal__footer {
    flex-direction: column;
  }
}

/* ─── Footer trigger link ─────────────────────── */
.consent-open-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-style: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
  vertical-align: baseline;
}
.consent-open-link:hover {
  color: var(--navy);
}
