/* ==========================================================================
   COOKIE CONSENT — see assets/consent.js
   Contrast checked against the panel background (#07293A): all text ≥ 4.5:1,
   both buttons ≥ 4.5:1, focus ring ≥ 3:1.
   ========================================================================== */

.qmc {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 12000;                       /* above the intro (999) and modals (200) */
  display: none;
  padding: 16px;
  pointer-events: none;
}
.qmc.is-open { display: block; }

.qmc-card {
  pointer-events: auto;
  max-width: 680px;
  margin: 0 auto;
  background: #07293A;
  color: #DCEEF1;
  border: 1px solid rgba(95, 212, 200, .38);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

.qmc h2 {
  font-family: 'Space Grotesk', 'Bricolage Grotesque', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #7FE3D9;                       /* 8.9:1 on #07293A */
  margin: 0 0 8px;
}
.qmc p {
  font-size: .92rem;
  line-height: 1.55;
  color: #C6E2E6;                       /* 10.2:1 */
  margin: 0 0 14px;
}
.qmc a {
  color: #7FE3D9;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.qmc a:hover { color: #A6EFE7; }
.qmc b { color: #EAF7F7; }

/* ---- actions ---- */
.qmc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.qmc-save { margin-top: 14px; }

.qmc-btn {
  font: 600 .88rem 'Bricolage Grotesque', system-ui, sans-serif;
  min-height: 44px;                      /* touch target */
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid rgba(198, 226, 230, .45);
  background: transparent;
  color: #DCEEF1;                        /* 11.0:1 */
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, transform .18s;
}
.qmc-btn:hover { background: rgba(198, 226, 230, .12); border-color: #C6E2E6; }
.qmc-btn:active { transform: translateY(1px); }

/* Accept and Reject are deliberately the same size and weight — one must not
   be easier to press than the other. */
.qmc-primary {
  background: #7FE3D9;
  border-color: #7FE3D9;
  color: #04202B;                        /* 12.6:1 on the mint fill */
}
.qmc-primary:hover { background: #A6EFE7; border-color: #A6EFE7; color: #04202B; }

.qmc-quiet {
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding-inline: 8px;
}
.qmc-quiet:hover { background: transparent; color: #7FE3D9; }

.qmc-btn:focus-visible {
  outline: 3px solid #FFD75E;            /* 9.4:1 on the panel, 3.4:1 on the mint fill */
  outline-offset: 3px;
}

/* ---- category rows ---- */
.qmc-rows {
  border-top: 1px solid rgba(198, 226, 230, .22);
  margin: 4px 0 0;
  padding-top: 14px;
}
.qmc-row + .qmc-row {
  border-top: 1px solid rgba(198, 226, 230, .14);
  margin-top: 14px;
  padding-top: 14px;
}
.qmc-row-body {
  font-size: .85rem;
  color: #B4D3D8;                        /* 8.3:1 */
  margin: 6px 0 0 58px;
}
.qmc-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  min-height: 44px;
}
.qmc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qmc-track {
  flex: 0 0 auto;
  width: 46px; height: 26px;
  border-radius: 999px;
  background: rgba(198, 226, 230, .18);
  border: 1px solid rgba(198, 226, 230, .45);
  position: relative;
  transition: background .18s, border-color .18s;
}
.qmc-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #DCEEF1;
  transition: transform .18s, background .18s;
}
.qmc-switch input:checked + .qmc-track { background: #7FE3D9; border-color: #7FE3D9; }
.qmc-switch input:checked + .qmc-track::after { transform: translateX(20px); background: #04202B; }
.qmc-switch input:disabled + .qmc-track { opacity: .6; }
.qmc-switch input:disabled ~ .qmc-name { color: #B4D3D8; }
.qmc-switch input:disabled + .qmc-track,
.qmc-switch input:disabled ~ * { cursor: not-allowed; }
.qmc-switch input:focus-visible + .qmc-track {
  outline: 3px solid #FFD75E;
  outline-offset: 3px;
}
.qmc-name {
  font: 600 .95rem 'Bricolage Grotesque', system-ui, sans-serif;
  color: #EAF7F7;
}
.qmc-name em { font-style: normal; font-weight: 400; color: #B4D3D8; font-size: .85em; }

/* ---- small screens ---- */
@media (max-width: 560px) {
  .qmc { padding: 10px; }
  .qmc-card { padding: 18px 16px; border-radius: 14px; }
  .qmc-actions { flex-direction: column; align-items: stretch; }
  .qmc-btn { width: 100%; }
  .qmc-row-body { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .qmc-btn, .qmc-track, .qmc-track::after { transition: none; }
}

/* The footer link that reopens the panel */
.foot-nav [data-consent-open] { cursor: pointer; }


/* ------------------------------------------------------------------------
   The banner waits for the entrance animation. Landing on an opaque water
   overlay AND a consent dialog at the same moment is two demands before a
   visitor has seen anything. app.js puts .intro-done on <body> when the
   intro finishes - and immediately, on every page that has no intro.
   Belt and braces: if scripts fail entirely the class never lands, so the
   no-JS rule below brings the banner back rather than hiding it for good.
   ------------------------------------------------------------------------ */
body:not(.intro-done) .qmc.is-open { opacity: 0; pointer-events: none; }
.qmc.is-open { transition: opacity .45s ease .25s; }
html:not(.js) .qmc.is-open { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .qmc.is-open { transition: none } }
