/* Consent, toast and modal surfaces shared by every layout. */

.cookie-banner {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.cookie-copy {
  flex: 1;
  min-width: 0;
}

.cookie-copy strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.cookie-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.cookie-copy a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.cookie-options label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.cookie-options label > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cookie-options strong {
  font-size: 12.5px;
  margin: 0;
}

.cookie-options small {
  color: var(--quiet);
  font-size: 11.5px;
}

.cookie-options input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.cookie-options .switch {
  width: 42px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: #cbd7dc;
  padding: 3px;
  flex: none;
  transition: background var(--speed) var(--ease);
}

.cookie-options .switch:before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--speed) var(--ease);
}

.cookie-options input:checked + .switch {
  background: var(--teal);
}

.cookie-options input:checked + .switch:before {
  transform: translateX(18px);
}

.cookie-options input:focus-visible + .switch {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.cookie-options input:disabled + .switch {
  background: var(--teal-dark);
  opacity: 0.55;
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cookie-actions .text-button {
  font-size: 12.5px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 18px;
  border-radius: var(--radius-input);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--danger);
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #0c233e73;
}

.modal-mask.visible {
  display: flex;
}

.modal {
  width: min(470px, 100%);
  padding: 30px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px #061f2f60;
}

.modal h2 {
  margin-bottom: 8px;
}

.modal p {
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

@media (max-width: 780px) {
  .cookie-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px 16px 18px;
  }
  .cookie-actions {
    justify-content: stretch;
  }
  .cookie-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
}
