/* Modal — soft purple sheet */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(30, 30, 45, 0.4);
  backdrop-filter: blur(6px);
}

.modal-overlay.open {
  display: flex;
  animation: scrimIn 0.2s ease;
}

@keyframes scrimIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: 100%;
  max-width: 430px;
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -12px 40px rgba(99, 85, 224, 0.15);
  animation: sheetUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sheetUp {
  from {
    transform: translateY(28px);
    opacity: 0.7;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 520px) {
  .modal-overlay {
    align-items: center;
    padding: 16px;
  }
  .modal {
    border-radius: 24px;
    max-height: 80vh;
  }
}

.modal-header {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e1e2d;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 14px;
  background: #ebe8ff;
  color: #6355e0;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.modal-close i {
  margin-top: 0 !important;
}

.modal-body {
  padding: 4px 20px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: #faf9ff;
}
