:host {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Full-body overlay below the header — the composer is not rendered during
 * consent (eo-chat hides it), so this fills everything under the header bar.
 * Prototype geometry adapted to the 400px drawer: type scaled down
 * proportionally, roomier top padding, and the card centered via
 * `margin: auto 0` (not justify-content) so overflow scrolls from the top
 * instead of clipping — content is sized to fit without a scrollbar on
 * typical drawer heights. */
.eo-consent {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 48px 30px 56px;
  overflow-y: auto;
  background: var(--eo-surface, #ffffff);

  /* Inheritable-property reset (L2). */
  font-family: var(--eo-font, system-ui, -apple-system, 'Segoe UI', sans-serif);
  font-size: 14px;
  line-height: 1.5;
  color: var(--eo-text, #1d1d1b);
  letter-spacing: normal;
  text-transform: none;
  text-align: start;
  font-style: normal;
  font-weight: 400;
}

.eo-consent-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 360px;
  gap: 16px; /* densidade "compacto" (frozen variant), scaled */
  margin: auto 0; /* overflow-safe vertical centering */
}

/* Subtle scrollbar for short viewports where the card can't fit */
.eo-consent::-webkit-scrollbar {
  width: 4px;
}

.eo-consent::-webkit-scrollbar-track {
  background: transparent;
}

.eo-consent::-webkit-scrollbar-thumb {
  background: var(--eo-border, #e3e4e0);
  border-radius: 2px;
}

.eo-consent-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.eo-consent-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--eo-green-soft, rgba(80, 200, 120, 0.12));
  color: var(--eo-green, #50c878);
  margin-bottom: 16px;
  flex-shrink: 0;
}

.eo-consent-icon svg {
  width: 20px;
  height: 20px;
}

.eo-consent-title {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.eo-consent-desc {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  color: var(--eo-text-2, #5a5a58);
  max-width: 34ch;
}

/* Checkbox rows — whole label clickable */
.eo-consent-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eo-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid transparent; /* keeps both rows aligned with the card row */
  cursor: pointer;
  position: relative;
}

.eo-check--card {
  background: var(--eo-green-soft, rgba(80, 200, 120, 0.12));
  border-color: var(--eo-border, #e3e4e0);
}

/* Native input visually hidden but focusable — the custom box mirrors it */
.eo-check-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.eo-check-box {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--eo-border-strong, #c9cac4);
  background: transparent;
  flex-shrink: 0;
  margin-top: 1px;
  transition: background 120ms ease, border-color 120ms ease;
}

.eo-check-box svg {
  color: var(--eo-on-green, #10240f);
  opacity: 0;
  transition: opacity 120ms ease;
}

.eo-check-input:checked + .eo-check-box {
  background: var(--eo-green, #50c878);
  border: 1px solid var(--eo-green, #50c878);
}

.eo-check-input:checked + .eo-check-box svg {
  opacity: 1;
}

.eo-check-input:focus-visible + .eo-check-box {
  outline: 2px solid var(--eo-green, #50c878);
  outline-offset: 2px;
}

.eo-check-input:disabled ~ .eo-check-label {
  opacity: 0.6;
}

.eo-check-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  line-height: 20px;
}

.eo-check-label a {
  color: var(--eo-link, #1e7a40);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.eo-check-label a:hover {
  color: var(--eo-green-hover, #34a85c);
}

.eo-check-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--eo-green-text, #1e7a40);
}

/* Error banner — the role="alert" container is always in the DOM so content
 * insertion is announced; the box only renders on error. */
.eo-consent-error {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--eo-danger-soft, rgba(179, 38, 30, 0.08));
  border: 1px solid var(--eo-danger, #b3261e);
  border-radius: 12px;
}

.eo-consent-error strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--eo-danger, #b3261e);
}

.eo-consent-error span {
  font-size: 12.5px;
  line-height: 19px;
  color: var(--eo-text-2, #5a5a58);
}

/* Actions — right-aligned, auto-width (prototype) */
.eo-consent-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.eo-consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.eo-consent-btn--ghost {
  background: transparent;
  padding: 11px 14px;
  font-weight: 600;
  color: var(--eo-text-2, #5a5a58);
}

.eo-consent-btn--ghost:hover:not(:disabled) {
  background: var(--eo-sunken, #f5f6f4);
  color: var(--eo-text, #1d1d1b);
}

.eo-consent-btn--primary {
  background: var(--eo-green, #50c878);
  padding: 11px 20px;
  font-weight: 700;
  color: var(--eo-on-green, #10240f);
}

.eo-consent-btn--primary:hover:not(:disabled):not([aria-disabled='true']) {
  background: var(--eo-green-hover, #34a85c);
}

/* Frozen variant: disabled = gray/"cinza" (spec §3.1) */
.eo-consent-btn--primary:disabled {
  background: var(--eo-sunken, #f5f6f4);
  color: var(--eo-text-3, #6c6c6a);
  cursor: not-allowed;
}

.eo-consent-btn--ghost:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Saving: focusable (no `disabled`) but inert — activation gated in the handler */
.eo-consent-btn--primary[aria-disabled='true']:not(:disabled) {
  cursor: default;
}

.eo-consent-btn:focus-visible {
  outline: 2px solid var(--eo-green, #50c878);
  outline-offset: 2px;
}

.eo-consent-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(16, 36, 15, 0.3);
  border-top-color: var(--eo-on-green, #10240f);
  animation: eo-consent-spin 800ms linear infinite;
}

@keyframes eo-consent-spin {
  to {
    transform: rotate(360deg);
  }
}
