/* =====================================================================
   SC interim website · Cookie consent · styles
   ---------------------------------------------------------------------
   Same glass card as the connection card. Desktop: bottom-right corner,
   380 px. Mobile (≤ 760 px): full-width panel at the bottom.

   Site integration notes (values are the owner reference, unchanged):
   - Every selector is scoped to the banner root ([data-consent]). The
     contact form on the home page already uses `.consent`, `.consent
     input` and `.consent__text` for its privacy checkbox (styles.css),
     so unscoped rules would fix-position the checkbox label and restyle
     the banner text whichever stylesheet loads last. The scope also
     outranks the site's global `:focus-visible` ring on the focused
     settings card. Explicit `display`/`cursor` on the root cancel the
     form rules that reach it.
   - Hit areas: transparent ::before boxes and a centred 44 px switch
     input give every control at least 44 × 44 px without moving or
     resizing anything visible; focus rings still follow the visible box.
   ===================================================================== */

.consent[data-consent] {
  --consent-bg: rgba(28, 44, 52, 0.96);
  --consent-border: rgba(255, 255, 255, 0.12);
  --consent-accent: #7ACCD6;
  --consent-accent-strong: #017A8C;
  --consent-text: #E8EEF0;
  --consent-text-2: #C9D4D7;
  --consent-muted: #A3B3B8;
  --consent-rule: rgba(255, 255, 255, 0.08);

  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: block;
  width: 380px;
  max-width: calc(100vw - 48px);
  font-family: var(--font-body, "Lato", sans-serif);
  color: var(--consent-text-2);
  cursor: auto;
}

.consent[data-consent][hidden] { display: none; }

.consent[data-consent].is-entering { animation: consent-in 0.35s ease-out; }

@keyframes consent-in {
  from { transform: translateY(12px); }
  to   { transform: translateY(0); }
}

[data-consent] .consent__card {
  box-sizing: border-box;
  padding: 16px 18px 18px;
  background: var(--consent-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--consent-border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  outline: none;
}

[data-consent] .consent__card[hidden] { display: none; }

/* Head: label with shield icon, one text button on the right */
[data-consent] .consent__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

[data-consent] .consent__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-heading, "Jost", sans-serif);
  font-weight: 500;
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--consent-accent);
}

[data-consent] .consent__title svg { width: 14px; height: 14px; flex-shrink: 0; }

[data-consent] .consent__link-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  line-height: 16px;
  color: var(--consent-accent);
  cursor: pointer;
}

/* 32 px visible, 44 px hit area */
[data-consent] .consent__link-btn::before {
  content: "";
  position: absolute;
  top: -6px;
  right: -8px;
  bottom: -6px;
  left: -8px;
}

[data-consent] .consent__link-btn svg { width: 14px; height: 14px; }

[data-consent] .consent__close {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -6px -8px -6px 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--consent-muted);
  cursor: pointer;
}

/* 32 × 32 visible, 44 × 44 hit area */
[data-consent] .consent__close::before {
  content: "";
  position: absolute;
  top: -6px;
  right: -6px;
  bottom: -6px;
  left: -6px;
}

[data-consent] .consent__close svg { width: 16px; height: 16px; }

/* Back (first visit) vs close (reopened from the footer) */
.consent[data-consent][data-mode="first"] .consent__close,
.consent[data-consent][data-mode="reopen"] .consent__back { display: none; }

[data-consent] .consent__text {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--consent-text-2);
}

[data-consent] .consent__text a,
[data-consent] .consent__text a:hover {
  color: var(--consent-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Two equal buttons */
[data-consent] .consent__actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

[data-consent] .consent__btn {
  position: relative;
  flex: 1 1 0;
  height: 40px;
  box-sizing: border-box;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-heading, "Jost", sans-serif);
  font-weight: 500;
  font-size: 14px;
  color: var(--consent-text);
  cursor: pointer;
}

/* 40 px visible, 44 px hit area (nothing clickable sits within 2 px) */
[data-consent] .consent__btn::before {
  content: "";
  position: absolute;
  top: -2px;
  right: 0;
  bottom: -2px;
  left: 0;
}

[data-consent] .consent__btn:hover { background: rgba(255, 255, 255, 0.12); }

[data-consent] .consent__btn:focus-visible,
[data-consent] .consent__link-btn:focus-visible,
[data-consent] .consent__close:focus-visible,
[data-consent] .consent__switch input:focus-visible + .consent__track {
  outline: 2px solid #00E9E6;
  outline-offset: 2px;
}

/* Settings rows */
[data-consent] .consent__rows {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}

[data-consent] .consent__row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--consent-rule);
}

[data-consent] .consent__row:last-child { border-bottom: 1px solid var(--consent-rule); }

[data-consent] .consent__row-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

[data-consent] .consent__row-name {
  font-size: 14px;
  line-height: 20px;
  color: var(--consent-text);
}

[data-consent] .consent__row-desc {
  font-size: 12.5px;
  line-height: 18px;
  color: var(--consent-muted);
}

[data-consent] .consent__always {
  flex-shrink: 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--consent-accent);
}

/* Switch: a real checkbox (role="switch") under a drawn track */
[data-consent] .consent__switch {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
}

/* The invisible checkbox is a 44 × 44 box centred on the 36 × 20 track:
   the track stays as drawn, the touch/click/focus target meets 44 px.
   Rows are ≥ 64 px apart, so neighbouring switches never overlap. */
[data-consent] .consent__switch input {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  opacity: 0;
  z-index: 1;
  cursor: pointer;
}

[data-consent] .consent__track {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.15s ease;
}

[data-consent] .consent__knob {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--consent-muted);
  transition: transform 0.15s ease, background 0.15s ease;
}

[data-consent] .consent__switch input:checked + .consent__track { background: var(--consent-accent-strong); }
[data-consent] .consent__switch input:checked + .consent__track .consent__knob { background: #FFFFFF; transform: translateX(16px); }

/* Footer button that reopens the settings. min-height 44 px at every
   width: the footer's legal links already are 44 px tall, so the row
   does not change, and the button meets the target size on desktop too. */
.consent-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: #7ACCD6;
  cursor: pointer;
}

.consent-open svg { width: 14px; height: 14px; }

/* Banner switched off in the site config: no footer button either */
html[data-consent-banner="off"] .consent-open,
html[data-consent-banner="off"] .consent[data-consent] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .consent[data-consent].is-entering { animation: none; }
  [data-consent] .consent__track, [data-consent] .consent__knob { transition: none; }
}

@media (max-width: 760px) {
  .consent[data-consent] {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
  }
  [data-consent] .consent__card { padding: 16px; background: rgba(28, 44, 52, 0.98); }
  [data-consent] .consent__text { margin-top: 6px; }
  [data-consent] .consent__actions { margin-top: 14px; }
  [data-consent] .consent__btn { height: 44px; }
  [data-consent] .consent__btn::before { top: 0; bottom: 0; }
  [data-consent] .consent__rows { margin-top: 8px; }
  [data-consent] .consent__switch { width: 40px; height: 24px; }
  [data-consent] .consent__knob { width: 20px; height: 20px; }
  [data-consent] .consent__switch input:checked + .consent__track .consent__knob { transform: translateX(16px); }
  .consent-open { min-height: 44px; gap: 8px; }
  .consent-open svg { width: 15px; height: 15px; }
}
