:root {
  --cookie-navy: #071c38;
  --cookie-ink: #12254a;
  --cookie-violet: #6255ff;
  --cookie-violet-deep: #4b3de7;
  --cookie-mist: #f5f5ff;
  --cookie-line: rgba(65, 85, 152, .2);
}

.cookie-consent {
  position: fixed;
  z-index: 10050;
  right: 20px;
  bottom: 20px;
  width: min(476px, calc(100vw - 40px));
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 180ms ease, transform 180ms cubic-bezier(.2, .8, .2, 1);
}

.cookie-consent.is-open { opacity: 1; transform: translateY(0); }

.cookie-consent-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--cookie-line);
  border-radius: 19px;
  background:
    radial-gradient(circle at 92% 0%, rgba(98, 85, 255, .15), transparent 31%),
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(247, 248, 255, .96));
  box-shadow: 0 17px 50px rgba(8, 24, 55, .15), 0 1px 0 rgba(255, 255, 255, .85) inset;
  color: var(--cookie-ink);
  backdrop-filter: blur(18px);
}

.cookie-consent-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 23px;
  left: 23px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(98, 85, 255, .62), transparent);
}

.cookie-consent-copy { max-width: 395px; }
.cookie-consent-copy strong { display: block; font: 700 19px/1.18 Inter, Arial, sans-serif; letter-spacing: -.03em; }
.cookie-consent-copy p { margin: 8px 0 0; color: #5a6986; font: 500 13px/1.52 Inter, Arial, sans-serif; }

.cookie-consent-settings {
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid rgba(94, 111, 167, .2);
  border-radius: 13px;
  background: rgba(255, 255, 255, .64);
}

.cookie-consent-settings label { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.cookie-consent-settings span { display: grid; gap: 3px; }
.cookie-consent-settings b { font: 700 13px/1.3 Inter, Arial, sans-serif; }
.cookie-consent-settings small { color: #63708a; font: 500 12px/1.42 Inter, Arial, sans-serif; }
.cookie-consent-settings input { width: 20px; height: 20px; accent-color: var(--cookie-violet); }

.cookie-consent-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.cookie-consent button {
  min-height: 39px;
  padding: 9px 13px;
  border: 1px solid #d7deef;
  border-radius: 10px;
  background: rgba(255, 255, 255, .68);
  color: #3c4c6e;
  font: 700 12px/1 Inter, Arial, sans-serif;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.cookie-consent button:hover,
.cookie-consent button:focus-visible {
  border-color: rgba(98, 85, 255, .45);
  background: #f5f4ff;
  color: var(--cookie-violet-deep);
  outline: none;
}

.cookie-consent button:focus-visible,
.cookie-preference-trigger:focus-visible { box-shadow: 0 0 0 3px rgba(98, 85, 255, .2); }

.cookie-consent .cookie-consent-accept {
  border-color: var(--cookie-violet);
  background: linear-gradient(135deg, #6255ff, #4d3ee3);
  color: #fff;
  box-shadow: 0 7px 16px rgba(84, 69, 224, .18);
}

.cookie-consent .cookie-consent-accept:hover,
.cookie-consent .cookie-consent-accept:focus-visible { border-color: #4233d1; background: #4b3de7; color: #fff; }

.cookie-preference-trigger {
  position: fixed;
  z-index: 10049;
  right: 16px;
  bottom: 16px;
  min-height: 35px;
  padding: 8px 11px;
  border: 1px solid rgba(98, 85, 255, .25);
  border-radius: 999px;
  background: rgba(250, 250, 255, .92);
  box-shadow: 0 8px 23px rgba(8, 24, 55, .12);
  color: #4f46bf;
  font: 700 12px/1 Inter, Arial, sans-serif;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.cookie-preference-trigger:hover,
.cookie-preference-trigger:focus-visible { border-color: rgba(98, 85, 255, .58); background: #fff; color: var(--cookie-violet-deep); outline: none; }

@media (max-width: 600px) {
  .cookie-consent { right: 0; bottom: 0; width: 100%; transform: translateY(100%); }
  .cookie-consent.is-open { transform: translateY(0); }
  .cookie-consent-card { padding: 21px 18px calc(18px + env(safe-area-inset-bottom)); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 22px 22px 0 0; }
  .cookie-consent-card::before { right: 18px; left: 18px; }
  .cookie-consent-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .cookie-consent-manage { grid-column: 1 / -1; order: 3; }
  .cookie-consent-actions button { min-height: 42px; font-size: 12px; }
  .cookie-preference-trigger { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
}

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

/* Compact, unobtrusive consent surface: the full control set remains available. */
.cookie-consent {
  right: 16px;
  bottom: 16px;
  width: min(360px, calc(100vw - 32px));
}
.cookie-consent-card { padding: 16px; border-radius: 16px; box-shadow: 0 13px 34px rgba(8, 24, 55, .13), 0 1px 0 rgba(255, 255, 255, .86) inset; }
.cookie-consent-card::before { right: 18px; left: 18px; }
.cookie-consent-copy { max-width: 310px; }
.cookie-consent-copy strong { font-size: 16px; }
.cookie-consent-copy p { margin-top: 6px; font-size: 12px; line-height: 1.43; }
.cookie-consent-settings { margin-top: 12px; padding: 10px 11px; border-radius: 11px; }
.cookie-consent-settings b { font-size: 12px; }
.cookie-consent-settings small { font-size: 11px; line-height: 1.35; }
.cookie-consent-settings input { width: 18px; height: 18px; }
.cookie-consent-actions { gap: 6px; margin-top: 12px; }
.cookie-consent button { min-height: 35px; padding: 7px 10px; border-radius: 9px; font-size: 11px; }

/* Keep the Resources right-hand context panel unobstructed on wide screens. */
@media (min-width: 761px) {
  body:has(.resources-hero) .cookie-consent {
    top: 92px;
    right: 18px;
    bottom: auto;
    left: auto;
    width: min(330px, calc(100vw - 36px));
  }
}

@media (max-width: 600px) {
  .cookie-consent { right: 10px; bottom: 10px; left: 10px; width: auto; transform: translateY(115%); }
  .cookie-consent-card { padding: 15px 14px calc(14px + env(safe-area-inset-bottom)); border: 1px solid var(--cookie-line); border-radius: 16px; }
  .cookie-consent-copy { max-width: none; }
  .cookie-consent-copy strong { font-size: 16px; }
  .cookie-consent-copy p { font-size: 11.5px; }
  .cookie-consent-actions { grid-template-columns: 1fr 1fr; margin-top: 11px; }
  .cookie-consent-actions button { min-height: 37px; }
}
