/* Shared consent component, BroadbandSwitch.uk speed test family.
   Author: Dr Alex J Martin-Smith.
   Each site sets the tokens below on :root to match its own look.
   --stc-accent-ink must contrast with --stc-accent (white on pink passes; on a light green use a dark ink). */
:root {
  --stc-accent: #e50571;
  --stc-accent-ink: #ffffff;
  --stc-bg: #ffffff;
  --stc-fg: #17181c;
  --stc-fg-2: #4b4e57;
  --stc-line: #dcd9d1;
  --stc-radius: 12px;
  --stc-font: inherit;
  --stc-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.stc-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9990;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--stc-bg);
  color: var(--stc-fg);
  border-top: 1px solid var(--stc-line);
  box-shadow: var(--stc-shadow);
  font-family: var(--stc-font);
  font-size: 15px;
  line-height: 1.5;
}
.stc-banner-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}
.stc-copy { flex: 1 1 420px; min-width: 0; }
.stc-copy p { margin: 0; }
.stc-title { font-weight: 700; font-size: 16px; margin-bottom: 2px !important; }
.stc-text { color: var(--stc-fg-2); max-width: 72ch; }
.stc-links { font-size: 13px; margin-top: 4px !important; }
.stc-links a, .stc-foot a { color: inherit; text-decoration: underline; text-decoration-color: var(--stc-accent); text-underline-offset: 3px; }
.stc-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }

.stc-btn {
  appearance: none;
  border: 1px solid var(--stc-line);
  background: var(--stc-bg);
  color: var(--stc-fg);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 44px;
}
.stc-btn:hover { border-color: var(--stc-fg-2); }
.stc-btn:focus-visible, .stc-close:focus-visible, .stc-switch input:focus-visible + .stc-slider { outline: 3px solid var(--stc-accent); outline-offset: 2px; }
.stc-btn-primary { background: var(--stc-accent); color: var(--stc-accent-ink); border-color: var(--stc-accent); }
.stc-btn-primary:hover { filter: brightness(0.94); }
.stc-btn-quiet { border-color: transparent; color: var(--stc-fg-2); text-decoration: underline; text-underline-offset: 3px; }

.stc-overlay {
  position: fixed; inset: 0; z-index: 9995;
  background: rgba(10, 12, 16, 0.55);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
@media (min-width: 640px) { .stc-overlay { align-items: center; padding: 24px; } }
.stc-modal {
  background: var(--stc-bg);
  color: var(--stc-fg);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  border-radius: var(--stc-radius) var(--stc-radius) 0 0;
  padding: 18px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  font-family: var(--stc-font);
  font-size: 15px;
  line-height: 1.5;
  box-shadow: var(--stc-shadow);
}
@media (min-width: 640px) { .stc-modal { border-radius: var(--stc-radius); padding: 22px 24px; } }
.stc-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.stc-modal-title { font-size: 19px; font-weight: 700; margin: 0; line-height: 1.25; }
.stc-close { appearance: none; border: 0; background: transparent; color: var(--stc-fg-2); font-size: 28px; line-height: 1; cursor: pointer; padding: 4px 8px; min-width: 44px; min-height: 44px; }
.stc-rows { display: grid; gap: 2px; margin: 8px 0 14px; }
.stc-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--stc-line); }
.stc-row:first-child { border-top: 0; }
.stc-row-copy { min-width: 0; }
.stc-row-label { font-weight: 700; display: block; cursor: pointer; }
.stc-row-text { margin: 2px 0 0; color: var(--stc-fg-2); font-size: 14px; }

.stc-switch { position: relative; flex: 0 0 52px; width: 52px; height: 30px; margin-top: 2px; }
.stc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.stc-slider { position: absolute; inset: 0; border-radius: 999px; background: var(--stc-line); transition: background 0.15s; cursor: pointer; }
.stc-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--stc-bg); box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: transform 0.15s; }
.stc-switch input:checked + .stc-slider { background: var(--stc-accent); }
.stc-switch input:checked + .stc-slider::after { transform: translateX(22px); }
.stc-switch input:disabled + .stc-slider { opacity: 0.55; cursor: default; }
.stc-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stc-foot { font-size: 13px; color: var(--stc-fg-2); margin: 12px 0 0; }

body.stc-banner-visible { padding-bottom: 180px; }
@media (min-width: 900px) { body.stc-banner-visible { padding-bottom: 120px; } }
body.stc-modal-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .stc-slider, .stc-slider::after { transition: none; }
}
