/* Design: Hybrid | Vibe: Civic Structure | Layout: Bottom sheet + preference dialog | Color: Restrained full-palette */
:root {
  --lp-blue: #003049;
  --lp-red: #d62828;
  --lp-orange: #f77f00;
  --lp-gold: #fcbf49;
  --lp-cream: #eae2b7;
  --lp-white: #fbfaf6;
  --lp-ink: #10212c;
  --lp-muted: #5a6870;
  --lp-border: rgba(0, 48, 73, 0.16);
  --lp-shadow: 0 24px 70px rgba(0, 18, 28, 0.22);
  --lp-ease: cubic-bezier(0.32, 0.72, 0, 1);
}

.lp-hidden {
  display: none !important;
}

.lp-banner,
.lp-modal,
.lp-floating {
  box-sizing: border-box;
  font-family: Manrope, Archivo, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--lp-ink);
}

.lp-banner *,
.lp-modal *,
.lp-floating * {
  box-sizing: border-box;
}

.lp-banner {
  position: fixed;
  z-index: 2147483000;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  max-width: 980px;
  margin: 0 auto;
  padding: 18px;
  background: rgba(251, 250, 246, 0.98);
  border: 1px solid var(--lp-border);
  border-radius: 16px;
  box-shadow: var(--lp-shadow);
}

.lp-banner__eyebrow {
  margin: 0 0 7px;
  color: var(--lp-red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lp-banner__text {
  margin: 0;
  max-width: 66ch;
  color: var(--lp-muted);
  font-size: 14px;
  line-height: 1.55;
}

.lp-banner__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  font-size: 13px;
}

.lp-banner a,
.lp-modal a,
a[data-privacy-preferences],
button[data-privacy-preferences] {
  color: inherit;
  text-decoration-color: rgba(214, 40, 40, 0.55);
  text-underline-offset: 3px;
}

.lp-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.lp-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms var(--lp-ease), background-color 180ms var(--lp-ease), border-color 180ms var(--lp-ease), color 180ms var(--lp-ease), opacity 180ms var(--lp-ease);
  touch-action: manipulation;
}

.lp-button:active,
.lp-floating:active {
  transform: scale(0.98);
}

.lp-button:focus-visible,
.lp-toggle input:focus-visible + span,
.lp-floating:focus-visible,
a[data-privacy-preferences]:focus-visible,
button[data-privacy-preferences]:focus-visible {
  outline: 3px solid rgba(252, 191, 73, 0.95);
  outline-offset: 3px;
}

.lp-button--primary {
  background: var(--lp-blue);
  color: var(--lp-white);
}

.lp-button--primary:hover {
  background: #062638;
}

.lp-button--danger {
  background: rgba(214, 40, 40, 0.08);
  color: var(--lp-red);
  border-color: rgba(214, 40, 40, 0.22);
}

.lp-button--danger:hover {
  background: rgba(214, 40, 40, 0.14);
}

.lp-button--ghost {
  background: transparent;
  color: var(--lp-blue);
  border-color: var(--lp-border);
}

.lp-button--ghost:hover {
  background: rgba(0, 48, 73, 0.06);
}

.lp-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 20, 31, 0.62);
}

.lp-modal {
  width: min(100%, 680px);
  max-height: min(760px, calc(100dvh - 36px));
  overflow: auto;
  padding: 22px;
  background: var(--lp-white);
  border: 1px solid rgba(234, 226, 183, 0.56);
  border-radius: 18px;
  box-shadow: var(--lp-shadow);
}

.lp-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.lp-modal h2 {
  margin: 0 0 8px;
  color: var(--lp-blue);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.lp-modal p {
  margin: 0;
  color: var(--lp-muted);
  font-size: 14px;
  line-height: 1.55;
}

.lp-close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--lp-border);
  border-radius: 999px;
  background: transparent;
  color: var(--lp-blue);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.lp-groups {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.lp-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--lp-border);
  border-radius: 14px;
  background: rgba(234, 226, 183, 0.16);
}

.lp-group h3 {
  margin: 0 0 5px;
  color: var(--lp-ink);
  font-size: 15px;
  line-height: 1.25;
}

.lp-always {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0, 48, 73, 0.1);
  color: var(--lp-blue);
  font-size: 12px;
  font-weight: 800;
}

.lp-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 58px;
  height: 34px;
}

.lp-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.lp-toggle span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(0, 48, 73, 0.2);
  pointer-events: none;
  transition: background-color 180ms var(--lp-ease);
}

.lp-toggle span::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--lp-white);
  box-shadow: 0 4px 14px rgba(0, 18, 28, 0.24);
  transition: transform 180ms var(--lp-ease);
}

.lp-toggle input:checked + span {
  background: var(--lp-orange);
}

.lp-toggle input:checked + span::after {
  transform: translateX(24px);
}

.lp-modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.lp-floating {
  position: fixed;
  z-index: 2147482999;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(234, 226, 183, 0.3);
  border-radius: 999px;
  background: rgba(0, 48, 73, 0.94);
  color: var(--lp-white);
  box-shadow: 0 16px 44px rgba(0, 18, 28, 0.28);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  gap: 8px;
  letter-spacing: 0;
  touch-action: manipulation;
  transition: transform 180ms var(--lp-ease), background-color 180ms var(--lp-ease), opacity 180ms var(--lp-ease);
}

.lp-floating:hover {
  background: #062638;
}

.lp-floating svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .lp-banner {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 16px;
  }

  .lp-actions,
  .lp-modal__footer {
    justify-content: stretch;
  }

  .lp-button {
    flex: 1 1 100%;
  }

  .lp-group {
    grid-template-columns: 1fr;
  }

  .lp-floating {
    left: max(14px, env(safe-area-inset-left));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 48px;
    padding: 0;
  }

  .lp-floating span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lp-button,
  .lp-floating,
  .lp-toggle span,
  .lp-toggle span::after {
    transition-duration: 1ms;
  }
}
