/* =============================================================================
   mv-cookie-consent.css — the consent banner and its settings panel.

   Loaded on every public page alongside css/site-chrome.css. Namespaced .mvcc-*
   for the same reason the chrome is namespaced .mv-*: most public pages still
   carry their own inline <style> with generic .btn / .card / .row rules, and a
   page's inline style beats a linked stylesheet. These names cannot collide.

   Token-derived throughout, so the banner is light when the site is light and
   deepens in dark mode. No hardcoded colour, no left-accent stripe, no emoji:
   the only mark is an inline SVG. Radii come from the scale in css/tokens.css.

   The banner is the one piece of UI that MUST be readable before the visitor
   has agreed to anything, so it takes no chances with contrast: surface is
   --panel over a scrim, text is --text / --text-3, and the primary action is
   the brand gradient with --on-brand, the same pairing the rest of the site
   uses for its primary buttons.
   ========================================================================== */

.mvcc-root {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 9000;               /* above the sticky navbar (50) and modals' base */
  display: flex;
  justify-content: center;
  padding: 16px;
  pointer-events: none;        /* only the card takes clicks */
}
.mvcc-root[hidden] { display: none; }

.mvcc-card {
  pointer-events: auto;
  width: 100%;
  max-width: 1080px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px 22px;
  /* Enters from below once, and only when motion is allowed. */
  animation: mvccIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes mvccIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ---- the default (collapsed) row --------------------------------------- */
.mvcc-row {
  display: flex;
  align-items: center;
  gap: 24px;
}
.mvcc-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--purple);
}
[data-theme="dark"] .mvcc-icon { color: var(--purple-bright); }
.mvcc-icon svg { width: 21px; height: 21px; }

.mvcc-copy { flex: 1; min-width: 0; }
.mvcc-title {
  margin: 0 0 4px;
  font-family: "Inter Tight", system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.mvcc-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-3);
}
.mvcc-text a {
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 2px;
}
[data-theme="dark"] .mvcc-text a { color: var(--purple-bright); }

.mvcc-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- buttons ------------------------------------------------------------ */
.mvcc-btn {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  appearance: none;
  overflow-wrap: break-word;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mvcc-btn:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}
.mvcc-btn.is-primary {
  background: var(--gradient);
  color: var(--on-brand);
  border-color: transparent;
}
.mvcc-btn.is-primary:hover { filter: brightness(1.06); }
.mvcc-btn.is-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.mvcc-btn.is-ghost:hover { background: var(--bg-2); }
.mvcc-btn.is-link {
  background: transparent;
  border-color: transparent;
  color: var(--text-3);
  padding: 12px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mvcc-btn.is-link:hover { color: var(--text); }

/* ---- the settings panel ------------------------------------------------- */
.mvcc-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}
.mvcc-panel[hidden] { display: none; }

.mvcc-opt {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}
.mvcc-opt:last-of-type { border-bottom: 0; }
.mvcc-opt-copy { flex: 1; min-width: 0; }
.mvcc-opt-t {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 3px;
}
.mvcc-opt-d {
  display: block;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-3);
}
.mvcc-locked {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 4px;
}

/* the switch: a real checkbox, restyled, so it stays keyboard and SR usable */
.mvcc-sw {
  flex: 0 0 auto;
  position: relative;
  width: 46px;
  height: 26px;
  margin: 0;
  appearance: none;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.mvcc-sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.mvcc-sw:checked {
  background: var(--gradient);
  border-color: transparent;
}
.mvcc-sw:checked::after { transform: translateX(20px); }
.mvcc-sw:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }

.mvcc-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  .mvcc-row { flex-wrap: wrap; gap: 16px; }
  .mvcc-actions { width: 100%; }
  .mvcc-btn { flex: 1; text-align: center; }
  .mvcc-btn.is-link { flex: 0 0 auto; }
}
@media (max-width: 560px) {
  .mvcc-root { padding: 10px; }
  .mvcc-card { padding: 18px 16px; }
  .mvcc-icon { display: none; }       /* the copy is the message, not the mark */
  .mvcc-actions { flex-wrap: wrap; }
  .mvcc-btn { flex: 1 1 100%; padding: 13px 16px; }
  .mvcc-panel-actions { flex-direction: column-reverse; }
  .mvcc-panel-actions .mvcc-btn { width: 100%; }
  .mvcc-opt { gap: 12px; }
}

/* ---- reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .mvcc-card { animation: none; }
  .mvcc-sw, .mvcc-sw::after, .mvcc-btn { transition: none; }
}
