/* =====================================================================
   AutoHive estate consent banner
   ---------------------------------------------------------------------
   Tint per division by setting --ah-consent-accent on :root in the site
   stylesheet. Everything else is shared so the seven sites cannot drift
   apart the way the footers did.

   It sits bottom left rather than across the whole screen on purpose: a
   full width bar covering the page reads as an obstacle, and an obstacle
   is what makes people click Accept without reading it.
   ===================================================================== */

.ah-consent {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9998;
  width: min(430px, calc(100vw - 32px));
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .28s ease, transform .28s ease;
}
.ah-consent.is-visible { opacity: 1; transform: translateY(0); }

.ah-consent__panel {
  background: #FFFFFF;
  color: #33415E;
  border: 1px solid #E3E8F0;
  border-top: 4px solid var(--ah-consent-accent, #009688);
  border-radius: 14px;
  box-shadow: 0 20px 54px rgba(10, 31, 68, .26);
  padding: 20px 22px 18px;
  font-family: 'Lato', system-ui, Arial, sans-serif;
  font-size: .92rem;
  line-height: 1.55;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.ah-consent h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 900;
  color: #0A1F44;
  line-height: 1.3;
}
.ah-consent p { margin: 0 0 12px; }

/* display:grid and the UA's [hidden]{display:none} have equal specificity,
   so this stylesheet wins and the panel renders even while hidden. It has
   to be turned off explicitly or the collapsed banner is 213px taller than
   it looks like it should be. Same for the hidden save button. */
.ah-consent__opts[hidden], .ah-consent__btn[hidden] { display: none; }

.ah-consent__opts {
  display: grid;
  gap: 12px;
  margin: 4px 0 16px;
  padding: 14px 15px;
  background: #F5F7FA;
  border-radius: 10px;
}
.ah-consent__opt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: .87rem;
  cursor: pointer;
}
.ah-consent__opt input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; }
.ah-consent__opt b { color: #0A1F44; font-weight: 900; }
.ah-consent__opt--locked { cursor: default; opacity: .78; }

.ah-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}
.ah-consent__btn {
  font: inherit;
  font-weight: 900;
  font-size: .88rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #C9D2E0;
  background: #FFFFFF;
  color: #0A1F44;
  cursor: pointer;
}
.ah-consent__btn:hover { border-color: #0A1F44; }
.ah-consent__btn--primary {
  background: var(--ah-consent-accent, #009688);
  border-color: var(--ah-consent-accent, #009688);
  color: #FFFFFF;
}
.ah-consent__btn--primary:hover { filter: brightness(.93); }
.ah-consent__btn--link {
  border-color: transparent;
  background: none;
  text-decoration: underline;
  padding-left: 6px;
  padding-right: 6px;
}
.ah-consent__btn:focus-visible {
  outline: 3px solid var(--ah-consent-accent, #009688);
  outline-offset: 2px;
}

.ah-consent__foot {
  margin: 12px 0 0;
  font-size: .8rem;
  color: #5A6A85;
}
.ah-consent__foot a { color: inherit; }

@media (max-width: 520px) {
  /* Tighter on a phone so the collapsed banner takes roughly a third of
     the screen rather than most of it. A panel that covers the page is
     what makes people dismiss it without reading. */
  .ah-consent { left: 8px; right: 8px; bottom: 8px; width: auto; }
  .ah-consent__panel { padding: 15px 16px 13px; font-size: .85rem; line-height: 1.45; }
  .ah-consent h2 { font-size: .98rem; margin-bottom: 5px; }
  .ah-consent p { margin-bottom: 10px; }
  .ah-consent__btn { flex: 1 1 auto; text-align: center; padding: 9px 12px; font-size: .84rem; }
  .ah-consent__btn--link { flex-basis: 100%; padding-top: 4px; padding-bottom: 2px; }
  .ah-consent__foot { margin-top: 9px; font-size: .75rem; }
  .ah-consent__opts { padding: 11px 12px; gap: 10px; }
  .ah-consent__opt { font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ah-consent { transition: none; transform: none; }
}
