/**
 * Folio — Cookie Consent (LGPD)
 */

.folio-cc {
  --cc-coral: #fd5b38;
  --cc-coral-deep: #e44522;
  --cc-ink: #0f1219;
  --cc-mute: #8b93a7;
  --cc-line: rgba(255, 255, 255, 0.1);
  --cc-paper: #fffcf8;
  --cc-ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: "Plus Jakarta Sans", "Parkinsans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.folio-cc[hidden] { display: none !important; }

.folio-cc__backdrop {
  position: fixed;
  inset: 0;
  z-index: 99980;
  background: rgba(10, 12, 18, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--cc-ease);
}

.folio-cc.is-prefs-open .folio-cc__backdrop {
  opacity: 1;
  pointer-events: auto;
}

.folio-cc__bar {
  position: fixed;
  z-index: 99990;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 22px 22px 20px;
  color: #f4f6fb;
  background:
    linear-gradient(135deg, rgba(253, 91, 56, 0.16) 0%, transparent 42%),
    linear-gradient(165deg, #171b27 0%, #0c0f16 55%, #16121c 100%);
  border: 1px solid var(--cc-line);
  border-radius: 24px;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(253, 91, 56, 0.08) inset;
  transform: translateY(28px);
  opacity: 0;
  transition: transform 0.45s var(--cc-ease), opacity 0.45s var(--cc-ease);
  overflow: hidden;
}

.folio-cc.is-visible .folio-cc__bar {
  transform: translateY(0);
  opacity: 1;
}

.folio-cc__bar::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253, 91, 56, 0.28), transparent 70%);
  pointer-events: none;
}

.folio-cc__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
}

@media (min-width: 720px) {
  .folio-cc__inner {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 20px;
  }
}

.folio-cc__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffb39f;
  background: rgba(253, 91, 56, 0.14);
  border: 1px solid rgba(253, 91, 56, 0.28);
  border-radius: 999px;
}

.folio-cc__title {
  margin: 0 0 8px;
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #fff;
}

.folio-cc__text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--cc-mute);
  max-width: 52ch;
}

.folio-cc__text a {
  color: #ffb39f;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.folio-cc__text a:hover {
  color: #fff;
}

.folio-cc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.folio-cc__btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.2s var(--cc-ease), background 0.2s, box-shadow 0.2s, color 0.2s;
}

.folio-cc__btn:hover {
  transform: translateY(-1px);
}

.folio-cc__btn:active {
  transform: translateY(0);
}

.folio-cc__btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.folio-cc__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.folio-cc__btn--soft {
  background: rgba(253, 91, 56, 0.14);
  color: #ffb39f;
  border: 1px solid rgba(253, 91, 56, 0.28);
}

.folio-cc__btn--soft:hover {
  background: rgba(253, 91, 56, 0.22);
  color: #fff;
}

.folio-cc__btn--primary {
  background: linear-gradient(135deg, #ff6d4a, var(--cc-coral-deep));
  color: #fff;
  box-shadow: 0 10px 28px rgba(253, 91, 56, 0.35);
}

.folio-cc__btn--primary:hover {
  box-shadow: 0 14px 32px rgba(253, 91, 56, 0.45);
}

/* Preferences panel */
.folio-cc__prefs {
  position: fixed;
  z-index: 99995;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 560px;
  max-height: min(82vh, 640px);
  margin: 0 auto;
  padding: 0;
  background: var(--cc-paper);
  color: var(--cc-ink);
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(40px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--cc-ease), opacity 0.4s var(--cc-ease);
}

.folio-cc.is-prefs-open .folio-cc__prefs {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.folio-cc.is-prefs-open .folio-cc__bar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.folio-cc__prefs-head {
  padding: 20px 22px 14px;
  border-bottom: 1px solid #ebe6df;
  background:
    linear-gradient(180deg, #fff7f3, #fffcf8);
}

.folio-cc__prefs-head h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.folio-cc__prefs-head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
}

.folio-cc__prefs-body {
  padding: 8px 12px 12px;
  overflow-y: auto;
  flex: 1;
}

.folio-cc__cat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  align-items: start;
  padding: 14px 12px;
  border-radius: 16px;
  transition: background 0.2s;
}

.folio-cc__cat:hover {
  background: #f7f3ed;
}

.folio-cc__cat-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.folio-cc__cat-desc {
  grid-column: 1 / 2;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #64748b;
}

.folio-cc__badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #059669;
  background: #d1fae5;
  border-radius: 999px;
  vertical-align: middle;
}

/* Toggle */
.folio-cc__switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.folio-cc__switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.folio-cc__switch input:disabled {
  cursor: not-allowed;
}

.folio-cc__switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d6cfc4;
  transition: background 0.25s;
}

.folio-cc__switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s var(--cc-ease);
}

.folio-cc__switch input:checked + span {
  background: linear-gradient(135deg, #ff6d4a, var(--cc-coral-deep));
}

.folio-cc__switch input:checked + span::after {
  transform: translateX(20px);
}

.folio-cc__switch input:disabled + span {
  background: #34d399;
  opacity: 0.85;
}

.folio-cc__prefs-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 18px 18px;
  border-top: 1px solid #ebe6df;
  background: #fffcf8;
}

.folio-cc__prefs-foot .folio-cc__btn--ghost {
  background: #f1ebe3;
  color: var(--cc-ink);
  border-color: transparent;
}

.folio-cc__prefs-foot .folio-cc__btn--ghost:hover {
  background: #e8e2d8;
}

.folio-cc__prefs-foot .folio-cc__btn--primary {
  color: #fff;
}

@media (max-width: 520px) {
  .folio-cc__bar,
  .folio-cc__prefs {
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-radius: 20px;
  }

  .folio-cc__actions {
    width: 100%;
  }

  .folio-cc__actions .folio-cc__btn {
    flex: 1 1 auto;
  }

  .folio-cc__btn--primary {
    flex: 1 1 100%;
  }
}
