/* Modal Backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
}

.modal-backdrop.fade-out {
  opacity: 0;
  transition: opacity 0.18s ease;
}

/* Modal Container */
.modal {
  background: #fff;
  width: 90%;
  max-width: 420px;
  padding: 24px 28px;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  font-family: Inter, system-ui, Arial, sans-serif;
  text-align: center;
  /* Use CSS variable for border color from main page */
  border: 2px solid var(--modal-color, #6f010a);
}

/* Modal position adjustment for mobile devices */
@media (max-width: 768px) {
  .modal-backdrop {
    align-items: flex-end;
    padding-bottom: 20vh;
  }
}

@media (max-width: 480px) {
  .modal-backdrop {
    align-items: flex-end;
    padding-bottom: 15vh;
  }
}

/* Modal Heading */
.modal h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  /* Use CSS variable for heading color */
  color: var(--modal-color, #6f010a);
  font-weight: 700;
}

/* Modal Text */
.modal p {
  margin: 0 0 18px;
  color: #374151;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Modal Actions Container */
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Button Base Styles */
.btn {
  border: 0;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.btn:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

/* Primary Button - Uses modal color */
.modal .btn:not(.ghost) {
  /* Use CSS variable for button background */
  background: var(--modal-color, #6f010a);
  color: #fff;
  box-shadow: 0 4px 15px rgba(111, 1, 10, 0.3);
}

.modal .btn:not(.ghost):hover {
  box-shadow: 0 6px 20px rgba(111, 1, 10, 0.5);
}

/* Ghost Button */
.btn.ghost {
  background: #f3f4f6;
  color: #111;
}

.btn.ghost:hover {
  background: #e5e7eb;
}