/* =============================================================================
   Aptris: Firebase UI (shared by every public page, loaded after styles.css)
   Markup is generated by /assets/js/firebase/*.js; keep these selectors:
   - Cookie / analytics consent       .consent, .consent__inner, __icon, __body,
     __title, __text, __actions (+ .btn .btn--primary/.btn--secondary .btn--sm)
   - Footer "Cookie settings" button  .site-footer__cookie-btn [data-cookie-settings]
   - Contact form error state         .form__status--error, .form__status a
   Uses the design tokens defined in styles.css.
   ========================================================================== */

/* ---------- Consent banner ---------- */
.consent {
  position: fixed;
  z-index: 900;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 600px;
  margin: 0;
  color: var(--on-dark);
  background: var(--brand-900);
  border-top: 3px solid var(--accent-500);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 64px -16px rgba(4, 12, 26, 0.55), 0 2px 6px rgba(4, 12, 26, 0.2);
  animation: fade-up 0.35s var(--ease-out) both;
  --focus-ring: var(--accent-200);
  --heading-color: #FFFFFF;
}
.consent[hidden] { display: none; }
/* A hairline keeps the card distinct from dark bands. */
.consent { border-left: 1px solid var(--line-on-dark); border-right: 1px solid var(--line-on-dark); border-bottom: 1px solid var(--line-on-dark); }
.consent__inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 18px;
  padding: 24px;
}
.consent__icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-btn);
  background: rgba(26, 167, 221, 0.14);
  border: 1px solid rgba(169, 221, 243, 0.4);
  color: var(--accent-200);
}
.consent__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.consent__title {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  color: #FFFFFF;
}
.consent__title:focus { outline: none; }
.consent__title:focus-visible { outline: 2px solid var(--accent-200); outline-offset: 3px; }
.consent__text { margin: 0; font-size: 0.9375rem; line-height: 1.55; color: var(--on-dark-muted); }
.consent__actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}
.consent .btn--primary {
  --btn-bg: var(--canvas);
  --btn-bg-hover: #FFFFFF;
  --btn-fg: var(--brand-900);
  --btn-fg-hover: var(--brand-900);
}
.consent .btn--secondary {
  --btn-bg: transparent;
  --btn-bg-hover: rgba(255, 255, 255, 0.1);
  --btn-fg: var(--on-dark);
  --btn-fg-hover: #FFFFFF;
  --btn-border: rgba(238, 242, 246, 0.6);
  --btn-border-hover: var(--on-dark);
}
.consent .btn[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--brand-900), 0 0 0 4px var(--accent-500); }
@media (min-width: 720px) {
  .consent { left: 24px; right: auto; bottom: 24px; }
}
/* Desktop: sit bottom-right, over the hero image, away from the hero CTA. */
@media (min-width: 1024px) {
  .consent { left: auto; right: 24px; max-width: 520px; }
  /* Until a choice is made, the banner would cover the hero carousel's
     Pause / Previous / Next buttons: lift them to the top of the image. */
  html.has-consent-banner .hero-carousel__controls { top: 0; bottom: auto; }
}
@media (max-width: 480px) {
  .consent__inner { grid-template-columns: 1fr; padding: 20px; }
  .consent__icon { display: none; }
  .consent__actions { grid-column: 1; }
  .consent__actions .btn { flex: 1 1 0; }
}
/* Touch-size buttons; hidden behind the open mobile menu. On every screen
   size, --consent-h (set by consent.js) keeps focused fields and the
   footer clear of the banner. */
.consent .btn { min-height: 44px; }
html.nav-open .consent { display: none; }
html.has-consent-banner { scroll-padding-bottom: calc(var(--consent-h, 280px) + 16px); }
html.has-consent-banner .site-footer { padding-bottom: calc(var(--consent-h, 280px) + 32px); }
@media (max-width: 480px) {
  .consent { left: 8px; right: 8px; bottom: 8px; }
  .consent__inner { gap: 8px; padding: 16px; }
  .consent__title { font-size: 1rem; }
  .consent__text { font-size: 0.875rem; line-height: 1.45; }
}
@media (prefers-reduced-motion: reduce) {
  .consent { animation: none; }
}

/* ---------- Footer "Cookie settings" button ---------- */
.site-footer__cookie-btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--on-dark-muted);
  cursor: pointer;
}
.site-footer__cookie-btn:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 0.2em; }

/* ---------- Contact form error state ---------- */
.form__status--error { border: 1px solid rgba(214, 69, 69, 0.3); }
.form__status--error:focus { outline: none; }
.form__status--error:focus-visible { outline: 2px solid var(--danger-500); outline-offset: 2px; }
.form__status a { color: var(--danger-700); font-weight: 600; text-decoration: underline; }
