/* Self-hosted cookie consent banner + preferences modal.
   Dark theme matched to TradingBotExperts; accessible and law-compliant. */

#tbe-cc,
#tbe-cc * {
  box-sizing: border-box;
}

#tbe-cc {
  --cc-bg: #0c0e10;
  --cc-surface: #15181b;
  --cc-border: #2a2f34;
  --cc-text: #f3f5f7;
  --cc-muted: #aab2bb;
  --cc-accent: #6ee881;
  --cc-accent-text: #05210c;
  font-family: "Instrument Sans", "Archivo", system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;
}

/* ---------- Banner ---------- */
.tbe-cc-banner {
  position: fixed;
  z-index: 2147483646;
  left: 16px;
  right: 16px;
  bottom: 16px;
  margin: 0 auto;
  max-width: 920px;
  background: var(--cc-bg);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  padding: 20px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  animation: tbe-cc-in 0.35s ease both;
}

@keyframes tbe-cc-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tbe-cc-banner__body {
  flex: 1 1 380px;
  min-width: 260px;
}

.tbe-cc-banner__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tbe-cc-banner__text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--cc-muted);
}

.tbe-cc-banner__text a {
  color: var(--cc-accent);
  text-decoration: underline;
}

.tbe-cc-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ---------- Buttons ---------- */
.tbe-cc-btn {
  appearance: none;
  border: 1px solid var(--cc-border);
  background: transparent;
  color: var(--cc-text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    transform 0.05s ease;
  white-space: nowrap;
}

.tbe-cc-btn:hover {
  border-color: var(--cc-muted);
}

.tbe-cc-btn:active {
  transform: translateY(1px);
}

.tbe-cc-btn:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

.tbe-cc-btn--primary {
  background: var(--cc-accent);
  border-color: var(--cc-accent);
  color: var(--cc-accent-text);
}

.tbe-cc-btn--primary:hover {
  filter: brightness(1.06);
  border-color: var(--cc-accent);
}

.tbe-cc-btn--ghost {
  background: var(--cc-surface);
}

/* ---------- Modal ---------- */
.tbe-cc-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  animation: tbe-cc-fade 0.25s ease both;
}

@keyframes tbe-cc-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.tbe-cc-modal__dialog {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--cc-bg);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  padding: 26px;
}

.tbe-cc-modal__title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 700;
}

.tbe-cc-modal__intro {
  margin: 0 0 20px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--cc-muted);
}

.tbe-cc-modal__intro a {
  color: var(--cc-accent);
  text-decoration: underline;
}

.tbe-cc-cat {
  border: 1px solid var(--cc-border);
  border-radius: 11px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--cc-surface);
}

.tbe-cc-cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tbe-cc-cat__name {
  font-size: 0.95rem;
  font-weight: 600;
}

.tbe-cc-cat__desc {
  margin: 8px 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--cc-muted);
}

/* Toggle switch */
.tbe-cc-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
}

.tbe-cc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.tbe-cc-switch__slider {
  position: absolute;
  inset: 0;
  background: #3a4046;
  border-radius: 999px;
  transition: background 0.2s ease;
  pointer-events: none;
}

.tbe-cc-switch__slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.tbe-cc-switch input:checked + .tbe-cc-switch__slider {
  background: var(--cc-accent);
}

.tbe-cc-switch input:checked + .tbe-cc-switch__slider::before {
  transform: translateX(20px);
}

.tbe-cc-switch input:disabled + .tbe-cc-switch__slider {
  background: var(--cc-accent);
  opacity: 0.5;
}

.tbe-cc-switch input:focus-visible + .tbe-cc-switch__slider {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

.tbe-cc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tbe-cc-modal__actions .tbe-cc-btn {
  flex: 1 1 auto;
}

/* ---------- Floating reopen button ---------- */
.tbe-cc-reopen {
  position: fixed;
  z-index: 2147483645;
  left: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--cc-border);
  background: var(--cc-bg);
  color: var(--cc-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.tbe-cc-reopen:hover {
  transform: translateY(-2px);
  border-color: var(--cc-muted);
}

.tbe-cc-reopen:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

.tbe-cc-reopen svg {
  width: 22px;
  height: 22px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .tbe-cc-banner {
    padding: 18px;
  }
  .tbe-cc-banner__actions {
    width: 100%;
  }
  .tbe-cc-banner__actions .tbe-cc-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}
