/*
 * MiTrust's cookie banner — public/js/consent.js builds it.
 *
 * A small card in the bottom-left corner, clear of the chat bubble on the
 * right: one sentence, and the choice in two equal buttons with the settings
 * one tap away. On a phone it spans the foot of the screen.
 */

.mtc {
  --mtc-ink: #16171b;
  --mtc-muted: #6b6c75;
  --mtc-line: rgb(22 23 27 / 0.09);
  --mtc-blue: #1a3cf0;
  --mtc-ease: cubic-bezier(0.22, 1, 0.36, 1);

  position: fixed;
  z-index: 2147483000;
  left: 20px;
  bottom: 20px;
  width: min(372px, calc(100vw - 40px));
  color: var(--mtc-ink);
  font-family: 'Onest Variable', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transform-origin: bottom left;
  transition: opacity 0.35s var(--mtc-ease), transform 0.45s var(--mtc-ease);
}

.mtc.is-in {
  opacity: 1;
  transform: none;
}

.mtc *,
.mtc *::before,
.mtc *::after {
  box-sizing: border-box;
}

.mtc-card {
  display: flex;
  flex-direction: column;
  padding: 16px 16px 14px 18px;
  border-radius: 18px;
  background: rgb(255 255 255 / 0.96);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  box-shadow:
    0 0 0 1px var(--mtc-line),
    0 24px 60px -24px rgb(16 18 40 / 0.35),
    0 6px 16px -10px rgb(16 18 40 / 0.2);
}

.mtc-text {
  margin: 0;
  color: var(--mtc-ink);
  font-size: 13.5px;
  line-height: 1.5;
}

.mtc-text a {
  color: var(--mtc-muted);
  text-decoration: underline;
  text-decoration-color: rgb(22 23 27 / 0.25);
  text-underline-offset: 2px;
}

.mtc-text a:hover {
  text-decoration-color: currentColor;
}

/* One row: the settings link on the left, and two buttons of the same size on
   the right — declining is as easy as accepting. */
.mtc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.mtc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--mtc-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}

.mtc-btn:hover {
  background: #000;
}

.mtc-btn:active {
  transform: scale(0.97);
}

.mtc-btn--ghost {
  color: var(--mtc-ink);
  background: rgb(22 23 27 / 0.06);
}

.mtc-btn--ghost:hover {
  background: rgb(22 23 27 / 0.1);
}

.mtc-link {
  margin-right: auto;
  padding: 4px 2px;
  border: 0;
  color: var(--mtc-muted);
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.mtc-link:hover {
  color: var(--mtc-ink);
}

/* In settings the two buttons are Decline and Save, at the right. */
.mtc.is-custom .mtc-actions {
  justify-content: flex-end;
}

/* ---- the detail */

.mtc-prefs {
  display: grid;
  gap: 0;
  margin: 12px 0 0;
  padding: 2px 0;
  border-top: 1px solid var(--mtc-line);
  border-bottom: 1px solid var(--mtc-line);
  animation: mtc-open 0.35s var(--mtc-ease);
}

.mtc-prefs[hidden] {
  display: none;
}

@keyframes mtc-open {
  from { opacity: 0; transform: translateY(-4px); }
}

.mtc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 8px 0;
  font-weight: 400;
  cursor: pointer;
}

.mtc-row-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.mtc-row-text b {
  font-size: 13.5px;
  font-weight: 600;
}

.mtc-row-text small {
  color: var(--mtc-muted);
  font-size: 12px;
  line-height: 1.4;
}

.mtc-always {
  color: var(--mtc-muted);
  font-size: 12px;
  font-weight: 500;
}

/* A switch, from a real checkbox. */
.mtc-switch {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
}

.mtc-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.mtc-switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgb(22 23 27 / 0.14);
  transition: background-color 0.2s;
  pointer-events: none;
}

.mtc-switch i::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);
  transition: transform 0.25s var(--mtc-ease);
}

.mtc-switch input:checked + i {
  background: var(--mtc-blue);
}

.mtc-switch input:checked + i::after {
  transform: translateX(16px);
}

.mtc-switch input:focus-visible + i,
.mtc button:focus-visible,
.mtc a:focus-visible {
  outline: 2px solid var(--mtc-blue);
  outline-offset: 2px;
}

/* ---- phones: a sheet across the foot of the screen */

@media (max-width: 520px) {
  .mtc {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    transform-origin: bottom center;
  }

  .mtc-card {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mtc,
  .mtc * {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .mtc {
    display: none;
  }
}
