.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  position: relative;
  max-width: min(480px, 90vw);
  width: 100%;
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  border: 1.5px solid var(--color-border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  padding: 36px 32px 28px;
  color: var(--color-text-primary);
  display: grid;
  gap: 16px;
}

.modal-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  letter-spacing: 0.02em;
}

.modal-subtitle {
  margin: 0;
  color: var(--color-text-secondary);
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.95rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.modal-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--border-radius-md);
  border: 2px solid var(--color-border);
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-base), border var(--transition-base), background var(--transition-base);
}

.modal-actions .btn-primary {
  background: var(--color-text-primary);
  color: var(--color-background);
  border-color: transparent;
}

.modal-actions .btn-secondary {
  background: transparent;
  color: var(--color-text-primary);
  justify-content: flex-start;
  text-align: left;
}

.modal-actions .btn:hover,
.modal-actions .btn:focus-visible {
  transform: translateY(-2px);
  border-color: var(--color-border-strong);
  outline: none;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-base), transform var(--transition-base);
}

.modal-close:hover,
.modal-close:focus-visible {
  color: var(--color-text-primary);
  transform: scale(1.05);
  outline: none;
}
