/* Consent menu: a compact card at the bottom and a dialog for the details. consent.js shows it; without script it stays hidden. */
.edugen-consent {
  display: contents;
  font-family: "Google Sans Flex Variable", Arial, sans-serif;
}

.edugen-consent[hidden],
.edugen-consent-card[hidden],
.edugen-footer .edugen-footer-settings[hidden] {
  display: none !important;
}

.edugen-consent-card {
  position: fixed;
  inset-block-end: 24px;
  inset-inline-start: 24px;
  z-index: 90;
  box-sizing: border-box;
  inline-size: calc(100vw - 48px);
  max-inline-size: 420px;
  padding: 18px 20px 14px;
  border: 1px solid #d9e4f1;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px #1829420a, 0 18px 40px -20px #1b3a6b55;
  color: #4c617a;
  animation: edugen-consent-in 200ms ease-out both;
}

@keyframes edugen-consent-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.edugen-consent-title {
  margin: 0;
  color: #182942;
  font-size: 16.5px;
  font-weight: 650;
  line-height: 1.3;
}

.edugen-consent-text {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
}

.edugen-consent-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-block-start: 14px;
}

.edugen-consent-choice,
.edugen-consent-save {
  box-sizing: border-box;
  min-block-size: 44px;
  padding: 10px 12px;
  border: 1px solid #d5e2f3;
  border-radius: 12px;
  background: #eef4fc;
  color: #1f4f96;
  font: 650 14px/1.2 "Google Sans Flex Variable", Arial, sans-serif;
  text-align: center;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.edugen-consent-choice:hover,
.edugen-consent-choice:focus-visible {
  border-color: #bcd1ee;
  background: #e3edfa;
}

.edugen-consent-save {
  background: #fff;
  white-space: nowrap;
}

.edugen-consent-save:hover,
.edugen-consent-save:focus-visible {
  background: #f4f8fd;
}

.edugen-consent-more {
  grid-column: 1 / -1;
  justify-self: center;
  min-block-size: 44px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: #36516f;
  font: 600 13.5px/1.2 "Google Sans Flex Variable", Arial, sans-serif;
  text-decoration: underline;
  text-underline-offset: 0.19em;
  cursor: pointer;
}

.edugen-consent-more:hover {
  color: #182942;
}

.edugen-consent :is(button, input, a):focus-visible,
.edugen-footer .edugen-footer-settings:focus-visible {
  outline: 2px solid #2e78e6;
  outline-offset: 3px;
}

.edugen-consent-dialog {
  box-sizing: border-box;
  inline-size: calc(100% - 24px);
  max-inline-size: 520px;
  max-block-size: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden auto;
  border: 1px solid #d9e4f1;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 1px 2px #1829420a, 0 24px 60px -24px #1b3a6b66;
  color: #4c617a;
  font-family: "Google Sans Flex Variable", Arial, sans-serif;
  --consent-pad: 24px;
}

.edugen-consent-dialog::backdrop {
  background: rgb(24 44 71 / 0.28);
}

.edugen-consent-dialog > * {
  margin-inline: var(--consent-pad);
}

.edugen-consent-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-start: calc(var(--consent-pad) - 8px);
}

.edugen-consent-dialog-title {
  margin: 8px 0 0;
  color: #182942;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.25;
}

.edugen-consent-close {
  display: grid;
  flex: none;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  margin-inline-end: -10px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: #36516f;
  cursor: pointer;
}

.edugen-consent-close svg {
  inline-size: 20px;
  block-size: 20px;
}

.edugen-consent-intro {
  margin-block: 4px 12px;
  font-size: 13.5px;
  line-height: 1.5;
}

.edugen-consent-list {
  margin-block: 0 8px;
  padding: 0;
  list-style: none;
}

.edugen-consent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
  border-block-start: 1px solid #d9e4f1;
}

.edugen-consent-row-text {
  min-inline-size: 0;
}

.edugen-consent-name {
  display: block;
  color: #182942;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.edugen-consent-desc {
  display: block;
  margin-block-start: 2px;
  font-size: 13.5px;
  line-height: 1.45;
}

.edugen-consent-state {
  flex: none;
  color: #1f4f96;
  font-size: 13px;
  font-weight: 650;
}

/* The switch: a 44 x 26 pill inside a 44 x 44 hit area. */
.edugen-consent-switch {
  position: relative;
  flex: none;
  inline-size: 44px;
  block-size: 44px;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.edugen-consent-switch::before,
.edugen-consent-switch::after {
  content: "";
  position: absolute;
  transition: background-color 160ms ease, translate 160ms ease;
}

.edugen-consent-switch::before {
  inset-block-start: 9px;
  inset-inline-start: 0;
  inline-size: 44px;
  block-size: 26px;
  border-radius: 999px;
  background: #7d93ae;
}

.edugen-consent-switch::after {
  inset-block-start: 12px;
  inset-inline-start: 3px;
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px #18294233;
}

.edugen-consent-switch:checked::before {
  background: #2569cb;
}

.edugen-consent-switch:checked::after {
  translate: 18px 0;
}

html[dir="rtl"] .edugen-consent-switch:checked::after {
  translate: -18px 0;
}

.edugen-consent-link {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  color: #205aa8;
  font-size: 13.5px;
  font-weight: 600;
  text-underline-offset: 0.19em;
}

.edugen-consent-dialog-actions {
  position: sticky;
  inset-block-end: 0;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  margin-block: 0 0;
  margin-inline: 0;
  padding: 14px var(--consent-pad) var(--consent-pad);
  border-block-start: 1px solid #d9e4f1;
  background: #fff;
}

@media (max-width: 639px) {
  .edugen-consent-card {
    inset-block-end: 12px;
    inset-inline: 12px;
    inline-size: auto;
    max-inline-size: none;
    padding-block-end: calc(12px + env(safe-area-inset-bottom));
  }

  .edugen-consent-dialog {
    --consent-pad: 18px;
  }

  .edugen-consent-dialog-actions {
    grid-template-columns: minmax(0, 1fr);
    padding-block-end: calc(var(--consent-pad) + env(safe-area-inset-bottom));
  }
}

/* The narrowest phones: the card must leave the page readable above it. */
@media (max-width: 359px) {
  .edugen-consent-card {
    padding: 14px 14px calc(8px + env(safe-area-inset-bottom));
  }
  .edugen-consent-title {
    font-size: 15.5px;
  }
  .edugen-consent-text {
    font-size: 13px;
    line-height: 1.45;
  }
  .edugen-consent-actions {
    gap: 8px;
    margin-block-start: 12px;
  }
  .edugen-consent-card .edugen-consent-choice {
    padding-inline: 6px;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* Read out when the card appears, never shown. */
.edugen-consent-status {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.edugen-footer .edugen-footer-settings {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--footer-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 630;
  line-height: 1.3;
  cursor: pointer;
}

.edugen-footer .edugen-footer-settings:hover {
  color: var(--footer-blue);
  text-decoration: underline;
  text-underline-offset: 0.19em;
}

.edugen-footer .edugen-footer-settings:focus-visible {
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .edugen-consent-card {
    animation: none;
  }

  .edugen-consent-switch::before,
  .edugen-consent-switch::after {
    transition: none;
  }
}
