/*
 * TU Wynajmiesz: cookie consent banner and settings (assets/consent.js). Uses the site's tokens
 * from main-*.css (colors, spacing, radii, shadows), so it looks like part of the product: a
 * white panel with a hairline border, blue primary action, no extra colors.
 * Accept and reject are equally sized buttons (consent must be as easy to refuse as to give).
 */
.consent-banner {
  position: fixed;
  inset-inline: var(--space-s);
  inset-block-end: var(--space-s);
  z-index: var(--z-overlay);
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.consent-banner__inner {
  display: grid;
  gap: var(--space-s);
  inline-size: 100%;
  max-inline-size: var(--container-default, 75rem);
  max-block-size: calc(100dvh - 2 * var(--space-s));
  overflow-y: auto;
  padding: var(--space-m);
  border: var(--border-width, 1px) solid var(--color-border);
  border-radius: var(--radius-xl);
  color: var(--color-text);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}

.consent-banner__copy {
  display: grid;
  gap: var(--space-2xs);
}

.consent-banner__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
}

.consent-banner__text {
  max-inline-size: var(--measure);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.consent-banner__link {
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Phones: one button per row, the main action last (in thumb reach) */
.consent-banner__actions {
  --button-white-space: normal;

  display: grid;
  gap: var(--space-2xs);
}

@media (width >= 48em) {
  .consent-banner {
    inset-block-end: var(--space-m);
  }

  .consent-banner__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-l);
    padding: var(--space-m) var(--space-l);
  }

  .consent-banner__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* After a choice, focus moves to the page content (consent.js): no ring around the whole page */
main[tabindex='-1']:focus {
  outline: none;
}

/* ---------- Settings dialog ---------- */
.consent-dialog__body {
  display: grid;
  gap: var(--space-m);
}

.consent-dialog__lead {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.consent-dialog__categories {
  display: grid;
  margin: 0;
  padding: 0;
  border-block-start: var(--border-width, 1px) solid var(--color-border);
  list-style: none;
}

/* Phones: the switch under the description; from 30em next to it */
.consent-dialog__category {
  display: grid;
  gap: var(--space-xs);
  padding-block: var(--space-s);
  border-block-end: var(--border-width, 1px) solid var(--color-border);
}

@media (width >= 30em) {
  .consent-dialog__category {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--space-s);
  }
}

.consent-dialog__category-copy {
  display: grid;
  gap: var(--space-3xs);
}

.consent-dialog__category-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.consent-dialog__category-text {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.consent-dialog__switch .switch__label {
  font-size: var(--text-sm);
  white-space: nowrap;
}

.consent-dialog__footer {
  --button-white-space: normal;
}
