.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 120000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  font-family: 'Montserrat', sans-serif;
}

.legal-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 92, 92, 0.12), transparent 36%),
    rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.legal-modal__panel {
  position: relative;
  width: min(500px, 94vw);
  max-height: min(86vh, 620px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  padding: 20px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(18, 18, 23, 0.94), rgba(9, 9, 12, 0.96)),
    rgba(255, 255, 255, 0.03);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.legal-modal__panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 92, 92, 0.95), transparent);
  opacity: 0.85;
}

.legal-modal__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.legal-modal__title::before {
  content: "\f15c";
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 92, 92, 0.32);
  border-radius: 12px;
  color: #ff5c5c;
  background: rgba(255, 92, 92, 0.1);
  font-family: "Font Awesome 6 Free";
  font-size: 17px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.legal-modal__text {
  max-height: clamp(180px, 44vh, 360px);
  overflow: auto;
  padding: 2px 4px 2px 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.65;
}

.legal-modal__text::-webkit-scrollbar {
  width: 8px;
}

.legal-modal__text::-webkit-scrollbar-track {
  background: transparent;
}

.legal-modal__text::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  background-clip: content-box;
}

.legal-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.legal-list li {
  min-width: 0;
}

.legal-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.055);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.legal-list a::after {
  content: "\f08e";
  flex: 0 0 auto;
  margin-left: 12px;
  color: rgba(255, 255, 255, 0.38);
  font-family: "Font Awesome 6 Free";
  font-size: 11px;
  font-weight: 900;
}

.legal-list a:hover {
  color: #fff;
  border-color: rgba(255, 92, 92, 0.34);
  background: rgba(255, 92, 92, 0.1);
  transform: translateY(-1px);
}

.legal-modal__actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-modal .btn-accept,
.legal-modal .btn-cancel {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.legal-modal .btn-accept {
  background: linear-gradient(90deg, #ff5c5c, #f33c3c);
  box-shadow: 0 10px 24px rgba(255, 60, 60, 0.2);
}

.legal-modal .btn-accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(255, 60, 60, 0.28);
}

.legal-modal .btn-cancel {
  background: rgba(255, 255, 255, 0.07);
}

.legal-modal .btn-cancel:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.11);
  transform: translateY(-1px);
}

.legal-modal .btn-accept:active,
.legal-modal .btn-cancel:active {
  transform: translateY(0);
}

.legal-modal .btn-accept:focus-visible,
.legal-modal .btn-cancel:focus-visible,
.legal-list a:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 92, 92, 0.18);
}

@media (max-width: 520px) {
  .legal-modal {
    padding: 14px;
  }

  .legal-modal__panel {
    padding: 18px;
    border-radius: 12px;
  }

  .legal-modal__title {
    font-size: 18px;
  }

  .legal-modal__title::before {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .legal-modal__actions {
    grid-template-columns: 1fr;
  }

  .legal-modal .btn-cancel {
    order: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-list a,
  .legal-modal .btn-accept,
  .legal-modal .btn-cancel {
    transition: none;
  }
}
