/* Cookie-Consent — dark terracotta theme (matches Prompt Architect tokens).
   Relies on the CSS custom properties defined in global.css (:root). */

.cookie-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: oklch(0 0 0 / 0.55);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cookie-overlay.visible { display: flex; }

.cookie-modal {
  background: var(--bg-1, #221e1a);
  border: 1px solid var(--border, #3a342f);
  border-radius: var(--r-lg, 22px);
  max-width: 520px;
  width: 100%;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding: 2rem;
  color: var(--text, #efece8);
  box-shadow: 0 40px 80px -30px oklch(0 0 0 / 0.7);
  font-family: var(--font-sans, system-ui, sans-serif);
}

.cookie-modal h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.cookie-modal > p {
  font-size: 0.92rem;
  color: var(--muted, #b3aca4);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.cookie-modal a {
  color: var(--accent-soft, #e8a070);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.cookie-btn {
  display: block;
  width: 100%;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.8rem 1.25rem;
  border-radius: var(--r-sm, 8px);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, background .2s ease, border-color .2s ease, color .2s ease;
  text-align: center;
}
.cookie-btn:hover { transform: translateY(-1px); }

.cookie-btn-all {
  background: var(--accent, #d97644);
  color: oklch(0.18 0.02 47);
}
.cookie-btn-all:hover { background: var(--accent-soft, #e8a070); }

.cookie-btn-necessary {
  background: transparent;
  color: var(--text, #efece8);
  border: 1px solid var(--border-2, #4a423b);
}
.cookie-btn-necessary:hover { border-color: var(--accent, #d97644); color: var(--accent-soft, #e8a070); }

.cookie-btn-settings {
  background: transparent;
  color: var(--faint, #827a72);
  border: none;
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.5rem;
}
.cookie-btn-settings:hover { color: var(--text, #efece8); transform: none; }

.cookie-settings {
  display: none;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border, #3a342f);
}
.cookie-settings.open { display: block; }

.cookie-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border, #3a342f);
}
.cookie-category:last-child { border-bottom: none; }
.cookie-cat-info { flex: 1; }
.cookie-cat-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text, #efece8);
  margin-bottom: 0.2rem;
}
.cookie-cat-info p {
  font-size: 0.8rem;
  color: var(--faint, #827a72);
  line-height: 1.5;
  margin: 0;
}

.cookie-toggle {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  margin-top: 2px;
}
.cookie-toggle input { opacity: 0; width: 0; height: 0; }
.cookie-toggle .slider {
  position: absolute;
  inset: 0;
  background: var(--border-2, #4a423b);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}
.cookie-toggle .slider::before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: var(--text, #efece8);
  border-radius: 50%;
  transition: transform 0.2s;
}
.cookie-toggle input:checked + .slider { background: var(--accent, #d97644); }
.cookie-toggle input:checked + .slider::before { transform: translateX(20px); }
.cookie-toggle input:disabled + .slider { opacity: 0.55; cursor: not-allowed; }

.cookie-save-row { margin-top: 1rem; text-align: center; }
.cookie-btn-save {
  background: var(--accent, #d97644);
  color: oklch(0.18 0.02 47);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.7rem 2rem;
  border-radius: var(--r-sm, 8px);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.cookie-btn-save:hover { background: var(--accent-soft, #e8a070); }

@media (max-width: 480px) {
  .cookie-modal { padding: 1.5rem; }
}
