/* ============================================================
   Cookie consent banner + preference center
   Shared by the app (index.html) and the landing page
   (landing/index.html) — relies only on brand variables that are
   defined identically in both css/tokens.css and landing/landing.css:
   --paper, --paper-deep, --ink, --muted, --border, --shadow, --serif, --sans.
   ============================================================ */

.cc-banner,
.cc-modal-backdrop,
.cc-banner * ,
.cc-modal-backdrop * {
  box-sizing: border-box;
}

.cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  padding: max(14px, env(safe-area-inset-bottom, 0px)) 16px 16px;
  background: var(--paper, #f4f0e4);
  border-top: 1px solid var(--border, rgba(61, 42, 26, 0.12));
  box-shadow: 0 -10px 28px rgba(61, 42, 26, 0.14);
  font-family: var(--sans, sans-serif);
  color: var(--ink, #3d2a1a);
}

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

.cc-banner__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 8px;
}

.cc-banner__text {
  flex: 1 1 320px;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted, #6b5040);
}

.cc-banner__actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cc-link {
  color: var(--ink, #3d2a1a);
  font-weight: 600;
  text-decoration: underline;
}

.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font-family: var(--sans, sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cc-btn--primary {
  color: var(--paper, #f4f0e4);
  background: var(--ink, #3d2a1a);
  border: 1px solid color-mix(in srgb, var(--ink, #3d2a1a) 80%, #000);
}

.cc-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(61, 42, 26, 0.22);
}

.cc-btn--ghost {
  color: var(--ink, #3d2a1a);
  background: transparent;
  border: 1px solid var(--border, rgba(61, 42, 26, 0.12));
}

.cc-btn--ghost:hover {
  background: var(--paper-deep, #e8e2d4);
}

/* ---------- Preference center modal ---------- */
.cc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 901;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(44, 36, 25, 0.45);
}

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

.cc-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  background: var(--paper, #f4f0e4);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(44, 36, 25, 0.24);
  font-family: var(--sans, sans-serif);
  color: var(--ink, #3d2a1a);
}

.cc-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted, #6b5040);
}

.cc-modal__close:hover {
  background: var(--paper-deep, #e8e2d4);
}

.cc-modal__title {
  margin: 0 30px 10px 0;
  font-family: var(--serif, serif);
  font-size: 1.4rem;
  font-weight: 700;
}

.cc-modal__desc {
  margin: 0 0 18px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted, #6b5040);
}

.cc-option {
  padding: 14px 0;
  border-top: 1px solid var(--border, rgba(61, 42, 26, 0.12));
}

.cc-option:last-of-type {
  border-bottom: 1px solid var(--border, rgba(61, 42, 26, 0.12));
}

.cc-option__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cc-option__title {
  font-weight: 700;
  font-size: 0.95rem;
}

.cc-option__badge {
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #6b5040);
  background: var(--paper-deep, #e8e2d4);
  border-radius: 999px;
}

.cc-option__desc {
  margin: 6px 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted, #6b5040);
}

.cc-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.cc-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cc-switch__track {
  position: absolute;
  inset: 0;
  background: var(--paper-deep, #e8e2d4);
  border: 1px solid var(--border, rgba(61, 42, 26, 0.12));
  border-radius: 999px;
  transition: background 0.15s ease;
}

.cc-switch__track::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);
  transition: transform 0.15s ease;
}

.cc-switch input:checked + .cc-switch__track {
  background: var(--ink, #3d2a1a);
}

.cc-switch input:checked + .cc-switch__track::before {
  transform: translateX(18px);
}

.cc-switch input:focus-visible + .cc-switch__track {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink, #3d2a1a) 40%, transparent);
}

.cc-modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

@media (max-width: 480px) {
  .cc-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }
  .cc-banner__actions {
    justify-content: stretch;
  }
  .cc-banner__actions .cc-btn {
    flex: 1;
  }
}

/* ---------- Reusable "reopen preferences" text link ---------- */
.cc-reopen-link {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .cc-btn,
  .cc-switch__track,
  .cc-switch__track::before {
    transition: none !important;
  }
}
