/* =========================================================
   MODAL BASE
========================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}


/* =========================================================
   MODAL OVERLAY
========================================================= */

.modal-overlay {
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}


/* =========================================================
   MODAL CONTENT
========================================================= */

.modal-content {
  position: relative;
  z-index: 1;

  width: min(90vw, 600px);
  max-height: 85vh;
  overflow-y: auto;

  padding: 28px;

  border-radius: 18px;

  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.88),
    rgba(255,255,255,0.68)
  );

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border: 1px solid rgba(255,255,255,0.35);

  box-shadow:
    0 20px 60px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.8);

  transform: scale(0.95) translateY(10px);
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}


/* =========================================================
   CLOSE BUTTON
========================================================= */

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;

  border: none;
  background: none;

  padding: 0;
  margin: 0;

  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;

  color: var(--blue-deep);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.modal-close:hover {
  transform: scale(1.08);
  opacity: 0.85;
}


/* =========================================================
   MODAL HEADER
========================================================= */

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-right: 28px; /* gives close button breathing room */
}

.modal-logo {
  height: 70px;
  width: auto;
  flex-shrink: 0;
  transform: translateY(-1px);
}

.modal-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--blue-deep);
}


/* =========================================================
   MODAL TYPOGRAPHY
========================================================= */

.modal-content h2 {
  margin-bottom: 12px;
}

.modal-content p {
  margin-bottom: 12px;
  line-height: 1.6;
  color: #2c3e50;
}

.modal-content a {
  color: var(--blue-deep);
  text-decoration: underline;
}

.modal-content i {
  color: var(--blue-deep);
  margin-right: 6px;
  vertical-align: middle;
}


/* =========================================================
   SCROLLBAR (SUBTLE)
========================================================= */

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(30, 79, 163, 0.25);
  border-radius: 999px;
}


/* =========================================================
   MOBILE TUNING
========================================================= */

@media (max-width: 768px) {
  .modal {
    padding: 14px;
    align-items: center;
  }

  .modal-content {
    width: 100%;
    max-height: 82vh;
    padding: 22px 20px;
    border-radius: 16px;
  }

  .modal-header {
    gap: 10px;
    margin-bottom: 12px;
  }

  .modal-logo {
    height: 54px;
  }

  .modal-title {
    font-size: 1.35rem;
  }

  .modal-close {
    top: 10px;
    right: 12px;
    font-size: 1.4rem;
  }
}