/* ==========================================================================
   DGREAT.AI — Cookie consent banner
   Reuses the site tokens from styles.css (--green, --purple, --font-mono…)
   with local fallbacks so the module can be dropped into another project.
   ========================================================================== */

.cc {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}

.cc__panel {
  pointer-events: auto;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.18));
  background: var(--surface, #0e141b);
  color: var(--text, #e6edf3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: cc-rise 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cc-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cc__panel { animation: none; }
}

.cc__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cc__body {
  margin: 0 0 18px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-dim, #9fb0c0);
}

/* ---------- per-category rows ---------- */
.cc__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 18px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.1));
}

.cc__row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.1));
}

.cc__row-text { flex: 1; }

.cc__row-name {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.cc__row-desc {
  display: block;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-dim, #9fb0c0);
}

.cc__always {
  flex-shrink: 0;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green, #00ff9d);
  padding-top: 3px;
}

/* ---------- switch ---------- */
.cc__switch {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  cursor: pointer;
}

.cc__switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.cc__slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.2s ease;
}

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

.cc__switch input:checked + .cc__slider { background: var(--green, #00ff9d); }
.cc__switch input:checked + .cc__slider::before { transform: translateX(18px); }

.cc__switch input:focus-visible + .cc__slider {
  outline: 2px solid var(--green, #00ff9d);
  outline-offset: 2px;
}

/* ---------- actions ---------- */
.cc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.cc__btn {
  flex: 1 1 140px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Accept and reject are deliberately identical — giving "accept" more visual
   weight than "reject" is a dark pattern regulators call out by name. */
.cc__btn--primary {
  background: var(--green, #00ff9d);
  color: #05070a;
}

.cc__btn--primary:hover { filter: brightness(1.08); }

.cc__btn--ghost {
  flex: 1 1 100%;
  background: transparent;
  border-color: var(--border-strong, rgba(255, 255, 255, 0.18));
  color: var(--text-dim, #9fb0c0);
}

.cc__btn--ghost:hover {
  border-color: var(--green, #00ff9d);
  color: var(--green, #00ff9d);
}

.cc__btn:focus-visible {
  outline: 2px solid var(--purple, #7a3cff);
  outline-offset: 2px;
}

.cc__link {
  font-size: 0.76rem;
  color: var(--text-dim, #9fb0c0);
  text-decoration: underline;
}

.cc__link:hover { color: var(--green, #00ff9d); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  .cc { padding: 10px; }
  .cc__panel { padding: 20px; border-radius: 16px; }
  .cc__btn { flex: 1 1 100%; }
}
