/* Geo-aware cookie disclosure (banner + preferences panel).
   Ported from r4m-addon-public-website src/Web/scss/cookie-consent.scss. */

.r4m-cd,
.r4m-cd-panel {
  --navy: #333e94;
  --navy-hover: #2a3480;
  --green: #80bf00;
  --green-hover: #8ace00;
  --link: #3f7fe8;
  --ink-title: rgba(0, 0, 0, .87);
  --ink-body: #555;
  --quiet-bg: #eceef3;
  --quiet-bg-h: #e0e3ec;
  --quiet-ink: #3b4051;
  --muted-ink: #9297a8;
  --hairline: #e7e9f0;
  --focus: #333e94;
  font-family: 'Open Sans', sans-serif;
}

.r4m-cd {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147483640;
  background: #fff;
  border-top: 1px solid var(--hairline, #e7e9f0);
  box-shadow: 0 -6px 28px rgba(28, 34, 60, .10);
  padding: 20px 26px;
}

.r4m-cd__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 44px;
}

.r4m-cd__copy {
  flex: 1;
  max-width: 780px;
  text-align: left;
}

.r4m-cd__title {
  margin: 0 0 5px;
  font-size: 18px;
  font-weight: 600;
  line-height: 120%;
  color: var(--ink-title, rgba(0, 0, 0, .87));
}

.r4m-cd__body {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  color: var(--ink-body, #555);
}

.r4m-cd__link {
  color: var(--link, #3f7fe8);
  text-decoration: none;
}

.r4m-cd__link:hover {
  text-decoration: underline;
}

/* Actions render as a right-hand column of equal-width buttons. */
.r4m-cd__actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 320px;
}

.r4m-cd .r4m-cd__btn,
.r4m-cd-panel .r4m-cd__btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  border-radius: 4px;
  padding: 13px 26px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-family: inherit;
  line-height: 1.2;
}

.r4m-cd .r4m-cd__btn--solid,
.r4m-cd-panel .r4m-cd__btn--solid {
  background: #333e94;
  background: var(--navy, #333e94);
  color: #fff;
}

.r4m-cd .r4m-cd__btn--solid:hover,
.r4m-cd-panel .r4m-cd__btn--solid:hover {
  background: #2a3480;
  background: var(--navy-hover, #2a3480);
}

.r4m-cd .r4m-cd__btn--quiet,
.r4m-cd-panel .r4m-cd__btn--quiet {
  background: #eceef3;
  background: var(--quiet-bg, #eceef3);
  color: #3b4051;
  color: var(--quiet-ink, #3b4051);
}

.r4m-cd .r4m-cd__btn--quiet:hover,
.r4m-cd-panel .r4m-cd__btn--quiet:hover {
  background: #e0e3ec;
  background: var(--quiet-bg-h, #e0e3ec);
}

.r4m-cd .r4m-cd__btn--go,
.r4m-cd-panel .r4m-cd__btn--go {
  background: #80bf00;
  background: var(--green, #80bf00);
  color: #fff;
}

.r4m-cd .r4m-cd__btn--go:hover,
.r4m-cd-panel .r4m-cd__btn--go:hover {
  background: #8ace00;
  background: var(--green-hover, #8ace00);
}

/* Outlined: same size as solid/quiet, navy border on white. */
.r4m-cd .r4m-cd__btn--ghost,
.r4m-cd-panel .r4m-cd__btn--ghost {
  background: transparent;
  border: 1px solid var(--navy, #333e94);
  color: #333e94;
  color: var(--navy, #333e94);
  padding: 12px 25px;
}

.r4m-cd .r4m-cd__btn--ghost:hover,
.r4m-cd-panel .r4m-cd__btn--ghost:hover {
  background: var(--quiet-bg, #eceef3);
}

/* The statutory CPRA opt-out label is long: let it wrap inside the column. */
.r4m-cd .r4m-cd__btn[data-cd-action='opt-out'] {
  white-space: normal;
  text-align: center;
  line-height: 1.45;
  padding-top: 9px;
  padding-bottom: 9px;
}

.r4m-cd .r4m-cd__btn:focus-visible,
.r4m-cd-panel .r4m-cd__btn:focus-visible,
.r4m-cd-toggle:focus-visible,
.r4m-cd-footer-link:focus-visible {
  outline: 2px solid var(--focus, #333e94);
  outline-offset: 2px;
}

.r4m-cd--row .r4m-cd__inner {
  justify-content: center;
  gap: 16px;
}

.r4m-cd--row .r4m-cd__actions {
  flex-direction: row;
  min-width: 0;
}

.r4m-cd--row .r4m-cd__copy {
  max-width: none;
  flex: 0 1 auto;
}

.r4m-cd--row .r4m-cd__body {
  font-size: 15px;
}

@media (max-width: 900px) {
  .r4m-cd__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .r4m-cd__actions {
    min-width: 0;
  }

  /* The notice-only variant carries a single action, so it keeps the production
     layout on phones: copy on the left, button beside it rather than beneath. */
  .r4m-cd--row {
    padding: 14px 16px;
  }

  .r4m-cd--row .r4m-cd__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .r4m-cd--row .r4m-cd__copy {
    flex: 1 1 auto;
  }

  .r4m-cd--row .r4m-cd__body {
    font-size: 13px;
    line-height: 18px;
  }

  .r4m-cd--row .r4m-cd__actions {
    flex: 0 0 auto;
  }

  .r4m-cd--row .r4m-cd__btn {
    padding: 9px 15px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .r4m-cd {
    animation: r4mCdIn .22s cubic-bezier(.2, .7, .3, 1);
  }
}

@keyframes r4mCdIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.r4m-cd-panel {
  position: fixed;
  inset: 0;
  z-index: 2147483645;
  display: none;
}

.r4m-cd-panel.is-open {
  display: block;
}

.r4m-cd-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 34, 60, .42);
}

.r4m-cd-panel__dialog {
  position: relative;
  z-index: 1;
  background: #fff;
  max-width: 560px;
  margin: 8vh auto;
  padding: 28px;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(28, 34, 60, .18);
  max-height: 84vh;
  overflow: auto;
}

/* Focus lands here programmatically when the panel opens; the default UA
   focus ring draws a blue border around the whole dialog. */
.r4m-cd-panel__dialog:focus {
  outline: none;
}

/* An opaque scrollbar track would overlay the right-hand corner radius. */
.r4m-cd-panel__dialog {
  scrollbar-width: thin;
  scrollbar-color: #c5c9d4 transparent;
}

.r4m-cd-panel__dialog::-webkit-scrollbar {
  width: 8px;
}

.r4m-cd-panel__dialog::-webkit-scrollbar-track {
  background: transparent;
}

.r4m-cd-panel__dialog::-webkit-scrollbar-thumb {
  background: #c5c9d4;
  border-radius: 4px;
}

.r4m-cd-panel__title {
  margin: 0 32px 12px 0;
  font-size: 30px;
  font-weight: 600;
  line-height: 120%;
  color: var(--ink-title, rgba(0, 0, 0, .87));
}

.r4m-cd-panel .r4m-cd-panel__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted-ink, #9297a8);
  transition: color .2s;
}

.r4m-cd-panel .r4m-cd-panel__close:hover {
  color: var(--quiet-ink, #3b4051);
}

.r4m-cd-panel .r4m-cd-panel__close:focus-visible {
  outline: 2px solid var(--focus, #333e94);
  outline-offset: 2px;
}

.r4m-cd-panel__intro,
.r4m-cd-panel__desc,
.r4m-cd-panel__korea,
.r4m-cd-panel__gpc {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-body, #555);
}

.r4m-cd-panel__row {
  padding: 14px 0;
  border-top: 1px solid var(--hairline, #e7e9f0);
}

.r4m-cd-panel__row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}

.r4m-cd-panel__label {
  font-size: 18px;
  font-weight: 600;
  line-height: 120%;
  color: var(--ink-title, rgba(0, 0, 0, .87));
}

.r4m-cd-panel__always {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--quiet-ink, #3b4051);
}

.r4m-cd-panel__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.r4m-cd-panel__actions .r4m-cd__btn--go {
  margin-left: auto;
}

.r4m-cd-panel .r4m-cd__btn--solid,
.r4m-cd-panel .r4m-cd__btn--go {
  padding: 11px 16px;
  flex: 0 1 auto;
  white-space: nowrap;
}

/* The knob is centred by flex, not by absolute offsets: fractional device pixel
   ratios round the two edges differently and the knob then looks off-centre. */
.r4m-cd-toggle {
  width: 44px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: #c5c9d4;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 0 3px;
}

.r4m-cd-toggle.is-on {
  background: #333e94;
}

.r4m-cd-toggle.is-disabled {
  opacity: .55;
  cursor: not-allowed;
}

.r4m-cd-toggle__knob {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28, 34, 60, .25);
  transition: transform .16s;
}

.r4m-cd-toggle.is-on .r4m-cd-toggle__knob {
  transform: translateX(18px);
}

.r4m-cd-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.r4m-cd-footer-link__icon {
  display: block;
}

@media (max-width: 640px) {
  .r4m-cd-panel__actions {
    flex-wrap: wrap;
  }

  .r4m-cd-panel__actions .r4m-cd__btn--go {
    margin-left: 0;
  }

  .r4m-cd-panel .r4m-cd__btn--solid,
  .r4m-cd-panel .r4m-cd__btn--go {
    flex: 1 1 45%;
  }
}
