/* consent.css — RGPD granular consent banner (Phase 0)
   Standalone so every page can load it without touching style.css.
   Inherits the site palette via the same CSS variables. */

/* Pull in the site-wide responsive layer (burger menu, touch sizing).
   @import must precede all other rules. Loaded everywhere consent.css is. */
@import url("responsive.css");


.consent-root {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  padding: 1rem;
  animation: consent-fade 0.3s ease;
}

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

.consent-panel {
  width: 100%;
  max-width: 640px;
  background: var(--bg, #fdfbf9);
  color: var(--text, #1a1a1a);
  border: 1px solid var(--border, #e5e0d8);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 1.75rem;
  animation: consent-rise 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes consent-rise {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.consent-title { margin: 0 0 0.5rem; font-size: 1.3rem; }
.consent-text { margin: 0 0 1.25rem; font-size: 0.92rem; line-height: 1.55; opacity: 0.9; }
.consent-text a { color: var(--accent, #5c7b56); text-decoration: underline; }

.consent-cats { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }

.consent-cat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.75rem;
  border: 1px solid var(--border, #e5e0d8);
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
}

/* Hide native checkbox; render an accessible switch. */
.consent-cat input { position: absolute; opacity: 0; width: 0; height: 0; }
.consent-switch {
  grid-row: 1 / span 2;
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--border, #ccc);
  transition: background 0.25s ease;
  flex-shrink: 0;
  margin-top: 2px;
}
.consent-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s ease;
}
.consent-cat input:checked + .consent-switch { background: var(--accent, #5c7b56); }
.consent-cat input:checked + .consent-switch::after { transform: translateX(18px); }
.consent-cat input:disabled + .consent-switch { opacity: 0.6; cursor: not-allowed; }
.consent-cat input:focus-visible + .consent-switch {
  outline: 2px solid var(--accent, #5c7b56);
  outline-offset: 2px;
}

.consent-cat-text { display: flex; flex-direction: column; gap: 0.15rem; }
.consent-cat-label { font-weight: 600; font-size: 0.95rem; }
.consent-cat-desc { font-size: 0.82rem; opacity: 0.75; line-height: 1.4; }

.consent-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.consent-btn {
  flex: 1 1 auto;
  min-width: 140px;
  min-height: 44px; /* touch target */
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-md, 8px);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--accent, #5c7b56);
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.consent-btn:hover { transform: translateY(-1px); }
.consent-btn:active { transform: translateY(0); }
.consent-btn--ghost { background: transparent; color: var(--text, #1a1a1a); border-color: var(--border, #e5e0d8); }
.consent-btn--solid { background: var(--accent, #5c7b56); color: #fff; }

@media (max-width: 520px) {
  .consent-panel { padding: 1.25rem; }
  .consent-actions { flex-direction: column; }
  .consent-btn { width: 100%; }
}
