/**
 * consent.css — Conceito ENAM
 * Banner LGPD seguindo o design system do projeto
 * Localização: /assets/consent/consent.css
 */

/* ── Overlay de bloqueio (escurece + trava a página) ── */
.consent-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.09 0.004 60 / 0.25);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  animation: consentFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.consent-overlay.consent-hidden {
  display: none;
}

@keyframes consentFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Painel inferior ── */
.consent-banner {
  position: relative;
  overflow: hidden;
  background: oklch(0.13 0.006 60);
  border: 1px solid oklch(0.96 0.005 80 / 0.1);
  border-bottom: none;
  border-radius: 1.5rem 1.5rem 0 0;
  padding: 2rem 2rem 2.5rem;
  max-width: 700px;
  width: 100%;
  box-shadow: 0 -20px 60px -10px oklch(0 0 0 / 0.55);
  animation: consentSlideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Glow dourado sutil no topo do banner */
.consent-banner::before {
  content: "";
  position: absolute;
  top: -5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26rem;
  height: 10rem;
  background: radial-gradient(ellipse at center, oklch(0.86 0.17 92 / 0.1) 0%, transparent 70%);
  pointer-events: none;
}

@keyframes consentSlideUp {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Textos ── */
.consent-banner__eyebrow {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: oklch(0.86 0.17 92);
  margin-bottom: 0.4rem;
}

.consent-banner__title {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 300;
  color: oklch(0.96 0.005 80);
  line-height: 1.15;
  margin-bottom: 0.65rem;
}

.consent-banner__title em {
  color: oklch(0.86 0.17 92);
  font-style: italic;
}

.consent-banner__desc {
  font-size: 0.77rem;
  color: oklch(0.62 0.01 70);
  line-height: 1.65;
  margin-bottom: 1.1rem;
}

.consent-banner__desc a {
  color: oklch(0.86 0.17 92);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Nota de cookie wall ── */
.consent-banner__wall-note {
  font-size: 0.73rem;
  color: oklch(0.62 0.01 70);
  background: oklch(0.86 0.17 92 / 0.05);
  border: 1px solid oklch(0.86 0.17 92 / 0.15);
  border-left: 3px solid oklch(0.86 0.17 92);
  border-radius: 0.5rem;
  padding: 0.7rem 1rem;
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.consent-banner__wall-note strong {
  color: oklch(0.86 0.17 92);
}

/* ── Botões ── */
.consent-banner__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9999px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.8rem 1.5rem;
  transition: filter 0.25s, transform 0.25s, box-shadow 0.25s;
  white-space: nowrap;
  text-decoration: none;
}

.consent-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* Aceitar todos — destaque dourado */
.consent-btn--accept {
  background: linear-gradient(135deg, oklch(0.92 0.16 95) 0%, oklch(0.78 0.17 82) 100%);
  color: oklch(0.09 0.004 60);
  flex: 1 1 auto;
  box-shadow: 0 8px 24px -8px oklch(0.86 0.17 92 / 0.45);
}

/* Personalizar — outline sutil */
.consent-btn--customize {
  background: transparent;
  color: oklch(0.96 0.005 80);
  border: 1px solid oklch(0.96 0.005 80 / 0.2);
  flex: 0 1 auto;
}

.consent-btn--customize:hover {
  border-color: oklch(0.86 0.17 92 / 0.4);
  color: oklch(0.86 0.17 92);
}

/* Sair da página — link discreto */
.consent-btn--leave {
  background: transparent;
  color: oklch(0.42 0.01 70);
  font-size: 0.62rem;
  padding: 0.5rem 0.5rem;
  flex: 0 1 auto;
  text-decoration: underline;
  text-underline-offset: 3px;
  letter-spacing: 0.1em;
}

.consent-btn--leave:hover {
  color: oklch(0.58 0.01 70);
  filter: none;
  transform: none;
}

/* ── Modal de personalização ── */
.consent-modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.09 0.004 60 / 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.consent-modal-overlay.consent-hidden {
  display: none;
}

.consent-modal {
  background: oklch(0.13 0.006 60);
  border: 1px solid oklch(0.96 0.005 80 / 0.1);
  border-radius: 1.25rem;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px -20px oklch(0 0 0 / 0.65);
  animation: consentSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.consent-modal__title {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 1.45rem;
  font-weight: 300;
  color: oklch(0.96 0.005 80);
  margin-bottom: 1.25rem;
}

/* ── Linhas de toggle ── */
.consent-toggle-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid oklch(0.96 0.005 80 / 0.06);
}

.consent-toggle-item:last-of-type {
  border-bottom: none;
}

.consent-toggle-item__info { flex: 1; }

.consent-toggle-item__name {
  font-size: 0.82rem;
  font-weight: 500;
  color: oklch(0.96 0.005 80);
  margin-bottom: 0.2rem;
}

.consent-toggle-badge {
  font-size: 0.58rem;
  color: oklch(0.86 0.17 92);
  letter-spacing: 0.1em;
  margin-left: 0.4rem;
}

.consent-toggle-item__desc {
  font-size: 0.71rem;
  color: oklch(0.52 0.01 70);
  line-height: 1.5;
}

/* Toggle switch */
.consent-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.consent-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.consent-switch__track {
  position: absolute;
  inset: 0;
  background: oklch(0.22 0.005 60);
  border-radius: 9999px;
  border: 1px solid oklch(0.96 0.005 80 / 0.1);
  cursor: pointer;
  transition: background 0.25s;
}

.consent-switch input:checked + .consent-switch__track {
  background: oklch(0.86 0.17 92);
}

.consent-switch input:disabled + .consent-switch__track {
  opacity: 0.5;
  cursor: not-allowed;
}

.consent-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: oklch(0.96 0.005 80);
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.consent-switch input:checked + .consent-switch__track::after {
  transform: translateX(18px);
  background: oklch(0.09 0.004 60);
}

.consent-modal__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ── Responsivo ── */
@media (max-width: 520px) {
  .consent-banner {
    padding: 1.5rem 1.25rem 2rem;
    border-radius: 1.25rem 1.25rem 0 0;
  }

  .consent-banner__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .consent-btn--accept,
  .consent-btn--customize {
    width: 100%;
    text-align: center;
  }

  .consent-btn--leave {
    text-align: center;
    padding: 0.4rem;
  }
}
