/*
 * Shared interaction layer loaded by every page after its own styles:
 * focus, skip link, button and card feedback, header depth and the cookie banner.
 * Motion stays on transform/opacity, 80-240ms, and is tiered for reduced motion.
 */
:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --focus-ring: var(--brand, #007F79);
}

/* Focus ------------------------------------------------------------------ */

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

.site-header :focus-visible,
.site-footer :focus-visible,
.hero :focus-visible,
.final-cta :focus-visible,
.consent-banner :focus-visible {
  outline-color: #8EFFF0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: #8EFFF0;
  color: #011719;
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 160ms var(--ease-out);
}

.skip-link:focus {
  transform: none;
}

/* Buttons and links ------------------------------------------------------ */

.btn {
  transition:
    transform 180ms var(--ease-out),
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.btn:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-1px);
  }

  .btn-primary:hover {
    box-shadow:
      0 12px 28px -12px rgba(24, 214, 207, 0.7),
      inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }

  .btn-secondary:hover {
    background: rgba(234, 253, 249, 0.14);
    border-color: rgba(234, 253, 249, 0.46);
  }
}

.topic-link em,
.page-card span {
  transition: transform 200ms var(--ease-out), color 160ms ease;
}

.topic-link strong,
.page-card h3 {
  transition: color 160ms ease;
}

@media (hover: hover) {
  .topic-link:hover strong,
  .page-card:hover h3 {
    color: var(--brand);
  }

  .topic-link:hover em,
  .page-card:hover span {
    transform: translateX(4px);
  }
}

.nav-links a,
.breadcrumb a,
.site-footer a,
.text-link {
  transition: color 160ms ease;
}

/* Form fields ------------------------------------------------------------ */

.mc-form input,
.mc-form textarea {
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.mc-form input:hover,
.mc-form textarea:hover {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
}

.mc-form input:focus-visible,
.mc-form textarea:focus-visible {
  /* Transparent outline keeps a ring in forced-colors mode, where shadows are dropped. */
  outline: 2px solid transparent;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 32%, transparent);
}

/* Header depth: the glass thickens as the page scrolls ------------------- */

@supports (animation-timeline: scroll()) {
  .site-header {
    animation: header-depth linear both;
    animation-timeline: scroll(root);
    animation-range: 0 180px;
  }
}

@keyframes header-depth {
  to {
    background: rgba(1, 23, 25, 0.86);
    box-shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.6);
  }
}

/* Reduced motion: drop movement, keep color and opacity feedback ---------- */

@media (prefers-reduced-motion: reduce) {
  .btn:hover,
  .btn:active,
  .topic-link:hover em,
  .page-card:hover span {
    transform: none;
  }
}

/* Cookie consent banner -------------------------------------------------- */

.consent-banner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 50;
  max-width: 560px;
  display: grid;
  gap: 14px;
  padding: 20px 22px;
  border: 1px solid rgba(234, 253, 249, 0.22);
  border-radius: 14px;
  background: rgba(1, 23, 25, 0.78);
  color: #EAFDF9;
  font-family: var(--text, "Manrope", ui-sans-serif, system-ui, sans-serif);
  font-size: 0.94rem;
  line-height: 1.5;
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow:
    0 24px 60px -20px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(234, 253, 249, 0.18);
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out), display 240ms allow-discrete;
}

.consent-banner[hidden] {
  display: none;
  opacity: 0;
  transform: translateY(12px);
}

@starting-style {
  .consent-banner {
    opacity: 0;
    transform: translateY(12px);
  }
}

.consent-banner h2 {
  margin: 0;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
}

.consent-banner p {
  margin: 0;
  color: rgba(234, 253, 249, 0.8);
}

.consent-banner a {
  color: #8EFFF0;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Accept and reject carry equal weight, as the ANPD cookie guide recommends. */
.consent-actions button {
  flex: 1 1 140px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(234, 253, 249, 0.4);
  border-radius: 8px;
  background: rgba(234, 253, 249, 0.08);
  color: #EAFDF9;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
}

.consent-actions button[data-consent="granted"] {
  border-color: #8EFFF0;
  background: #8EFFF0;
  color: #011719;
}

.consent-actions button:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .consent-actions button[data-consent="denied"]:hover {
    border-color: rgba(234, 253, 249, 0.7);
    background: rgba(234, 253, 249, 0.16);
  }

  .consent-actions button[data-consent="granted"]:hover {
    background: #B5FFF5;
  }
}

@media (min-width: 640px) {
  .consent-banner {
    right: auto;
    bottom: 24px;
    left: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .consent-banner,
  .consent-banner[hidden] {
    transform: none;
  }

  .consent-actions button:active {
    transform: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .consent-banner {
    background: #011719;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .consent-banner {
    background: rgba(1, 23, 25, 0.96);
  }
}
