/* Legal modals (signup acceptance + re-consent on a version bump).
   Both used raw Bootstrap: grey body, flat header, default checkboxes, blue
   link — none of it matching the app. This dresses them in the easyIDP theme
   (glass card, brand gradient header, lime/teal controls) without touching
   their markup semantics. Scoped to .legal-modal so nothing else is affected. */

/* Opaque on purpose: this modal blocks the app until it is answered, so the page
   behind it must not read through the text. Solid base + the usual glass tint. */
.legal-modal .modal-content {
  border: 1px solid var(--glass-b);
  border-radius: 18px;
  background-color: #0a1122;
  background-image: linear-gradient(180deg, rgba(20, 32, 68, .55), rgba(10, 17, 34, .55));
  color: var(--ink);
  box-shadow: 0 26px 70px -22px rgba(0, 0, 0, .85);
  overflow: hidden;
}

.legal-modal .modal-header {
  padding: 1.15rem 1.4rem .95rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background:
    radial-gradient(620px 220px at 15% 0, rgba(34, 179, 157, .26), transparent 100%),
    radial-gradient(620px 220px at 92% 0, rgba(154, 245, 87, .16), transparent 100%);
}

.legal-modal .modal-title {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  margin: 0;
  font-weight: 800;
  letter-spacing: .2px;
  color: var(--ink);
}

.legal-modal .modal-title i {
  color: var(--easyidp-cyan);
  font-size: 1.05rem;
}

.legal-modal .modal-body {
  padding: 1.35rem 1.4rem 1.2rem;
}

.legal-modal .modal-body > p:first-child {
  margin-bottom: 1.05rem;
  color: rgba(246, 251, 255, .88);
}

/* Each consent line reads as a distinct, clickable card. */
.legal-modal .form-check {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  margin: 0 0 .6rem;
  padding: .8rem .95rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  transition: border-color .18s ease, background .18s ease;
}

.legal-modal .form-check:hover {
  border-color: rgba(97, 199, 211, .32);
  background: rgba(255, 255, 255, .06);
}

.legal-modal .form-check:has(.form-check-input:checked) {
  border-color: rgba(154, 245, 87, .34);
  background: rgba(154, 245, 87, .08);
}

.legal-modal .form-check-input {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin: .15rem 0 0;
  border: 1px solid rgba(255, 255, 255, .3);
  background-color: rgba(255, 255, 255, .06);
  cursor: pointer;
}

.legal-modal .form-check-input:checked {
  background-color: var(--easyidp-teal);
  border-color: var(--easyidp-teal);
}

.legal-modal .form-check-input:focus {
  border-color: rgba(97, 199, 211, .6);
  box-shadow: 0 0 0 .2rem rgba(97, 199, 211, .22);
}

.legal-modal .form-check-label {
  cursor: pointer;
  line-height: 1.45;
  color: rgba(246, 251, 255, .94);
}

.legal-modal .legal-modal-note {
  margin: .15rem 0 1rem;
  font-size: .85rem;
  line-height: 1.5;
  color: rgba(246, 251, 255, .6);
}

.legal-modal .legal-modal-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 700;
  color: var(--easyidp-cyan);
  text-decoration: none;
}

.legal-modal .legal-modal-link:hover {
  color: var(--easyidp-lime);
  text-decoration: underline;
}

.legal-modal .legal-modal-error {
  margin: .85rem 0 0;
  font-size: .85rem;
  color: var(--easyidp-danger);
}

.legal-modal .modal-footer {
  gap: .75rem;
  padding: 1rem 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .2);
}

.legal-modal .btn-easyidp {
  border-radius: 12px;
}

.legal-modal .btn-easyidp:disabled {
  transform: none;
  filter: grayscale(.4);
  opacity: .45;
  box-shadow: none;
  cursor: not-allowed;
}

/* Secondary action (log out / cancel): present but never competing with the CTA. */
.legal-modal .legal-modal-secondary {
  padding: .6rem 1rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  background: none;
  color: rgba(246, 251, 255, .78);
  font-weight: 700;
  letter-spacing: .2px;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.legal-modal .legal-modal-secondary:hover {
  border-color: rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .05);
  color: var(--ink);
}

@media (max-width: 575.98px) {
  .legal-modal .modal-header,
  .legal-modal .modal-body,
  .legal-modal .modal-footer {
    padding-inline: 1.05rem;
  }

  .legal-modal .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .legal-modal .modal-footer > * {
    width: 100%;
  }
}
