/* BN Coaching & Health — own consent dialog + cookie table (2026-09-27).
   Own "bn-" classes only: app.css is a compiled Tailwind build and has no utilities beyond what the site uses.
   Palette taken from the site: #FBFAF8 paper, #F5F0EB sand, #E8E2DA line, #6E6259 brown, #4A4A4A text, #2A2622 ink.
   Contrast (WCAG AA): #4A4A4A on #FBFAF8 = 8.5:1, #FBFAF8 on #6E6259 = 5.7:1, #6E6259 on #FBFAF8 = 5.7:1. */

html.bn-consent-open { overflow: hidden; padding-right: var(--bn-sbw, 0px); }

.bn-consent {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px;
  font-family: Inter, sans-serif;
  -webkit-hyphens: manual; hyphens: manual; /* the site hyphenates globally; keep cookie names and words intact */
}
.bn-consent[hidden] { display: none !important; }
.bn-consent__backdrop { position: absolute; inset: 0; background: rgba(42, 38, 34, 0.45); }

.bn-consent__dialog {
  position: relative; width: 100%; max-width: 620px;
  max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
  overflow-y: auto; overscroll-behavior: contain;
  background: #FBFAF8; color: #4A4A4A;
  border: 1px solid #E8E2DA; border-radius: 16px;
  box-shadow: 0 24px 60px rgba(42, 38, 34, 0.28);
  padding: 22px 20px 20px;
  animation: bn-consent-in .35s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes bn-consent-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bn-consent__dialog { animation: none; } }
@media (min-width: 640px) {
  .bn-consent { padding: 24px; }
  .bn-consent__dialog { padding: 30px 32px 28px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); }
}

.bn-consent__title {
  margin: 0; font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; color: #4A4A4A;
}
.bn-consent__title:focus { outline: none; }
.bn-consent__text { margin: 10px 0 0; font-size: 15px; line-height: 1.65; color: #4A4A4A; }
.bn-consent__link { color: #6E6259; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; white-space: nowrap; }
.bn-consent__link:hover { color: #2A2622; }

.bn-consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.bn-consent__actions .bn-cbtn--ghost { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .bn-consent__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
  .bn-consent__actions .bn-cbtn--ghost { margin-left: auto; }
}

.bn-cbtn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px; margin: 0;
  border-radius: 8px; border: 1.5px solid #6E6259;
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.bn-cbtn--solid { background: #6E6259; color: #FBFAF8; }
.bn-cbtn--solid:hover { background: #574D46; border-color: #574D46; }
.bn-cbtn--ghost { background: transparent; color: #6E6259; }
.bn-cbtn--ghost:hover { background: #F5F0EB; }

.bn-consent__back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin: -4px 0 10px; padding: 4px 0;
  background: none; border: 0; font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: #6E6259; cursor: pointer;
}
.bn-consent__back:hover { color: #2A2622; }

.bn-consent__cats { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.bn-consent__cat { border: 1px solid #E8E2DA; border-radius: 12px; padding: 14px 16px; background: #FFFFFF; }
.bn-consent__cat-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bn-consent__cat-title { margin: 0; font-size: 15px; font-weight: 600; color: #4A4A4A; cursor: default; }
label.bn-consent__cat-title { cursor: pointer; }
.bn-consent__cat p { margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: #4A4A4A; }
.bn-consent__badge { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: #6E6259; white-space: nowrap; }

/* Switch: native checkbox (role="switch"), 48x28 */
.bn-switch {
  -webkit-appearance: none; appearance: none; position: relative; flex: none;
  width: 48px; height: 28px; margin: 0; border-radius: 999px;
  border: 2px solid #6E6259; background: #FBFAF8; cursor: pointer; transition: background-color .2s;
}
.bn-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #6E6259; transition: transform .2s, background-color .2s;
}
.bn-switch:checked { background: #6E6259; }
.bn-switch:checked::after { transform: translateX(20px); background: #FBFAF8; }
@media (prefers-reduced-motion: reduce) { .bn-switch, .bn-switch::after { transition: none; } }

/* Visible keyboard focus */
.bn-cbtn:focus-visible, .bn-consent__back:focus-visible, .bn-consent__link:focus-visible, .bn-switch:focus-visible {
  outline: 2px solid #2A2622; outline-offset: 3px;
}

/* Footer "Cookie settings" trigger — looks like the neighbouring footer links */
.bn-linkbtn { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.bn-linkbtn:focus-visible { outline: 2px solid #FBFAF8; outline-offset: 3px; border-radius: 2px; }

/* Privacy page: cookie table (stacks into cards below 640px) */
.bn-policy-gap { margin-top: 14px; }
.bn-cookie-table-wrap { margin-top: 16px; border: 1px solid #E8E2DA; border-radius: 12px; background: #FFFFFF; overflow: hidden; }
.bn-cookie-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; -webkit-hyphens: manual; hyphens: manual; }
.bn-cookie-table th, .bn-cookie-table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid #E8E2DA; }
.bn-cookie-table thead th { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #6E6259; background: #F5F0EB; }
.bn-cookie-table tbody tr:last-child > * { border-bottom: 0; }
.bn-cookie-table code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: #2A2622; white-space: nowrap; }
@media (max-width: 639px) {
  .bn-cookie-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bn-cookie-table, .bn-cookie-table tbody, .bn-cookie-table tr, .bn-cookie-table th, .bn-cookie-table td { display: block; }
  .bn-cookie-table tr { padding: 12px 14px; border-bottom: 1px solid #E8E2DA; }
  .bn-cookie-table tbody tr:last-child { border-bottom: 0; }
  .bn-cookie-table th, .bn-cookie-table td { padding: 2px 0; border: 0; }
  .bn-cookie-table td::before { content: attr(data-label) ": "; font-weight: 600; color: #6E6259; }
}
