/* ==========================================================================
   Modal — accessible dialog for the gated resource download prototype.
   Driven by js/resource-modal.js (focus trap, ESC to close, restores focus).
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: rgba(6, 10, 20, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-navy-900);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
}

.modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.modal__close:hover {
  color: var(--accent);
  border-color: var(--border-accent);
}

.modal__close svg {
  width: 16px;
  height: 16px;
}

.modal__eyebrow {
  margin-bottom: var(--space-sm);
}

.modal__title {
  font-size: 1.5rem;
  margin-bottom: var(--space-2xs);
}

.modal__lead {
  font-size: var(--text-small);
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.modal__success {
  display: none;
  text-align: center;
  padding: var(--space-lg) 0;
}

.modal__success.is-visible {
  display: block;
}

.modal__success-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--space-md);
  border-radius: 50%;
  background: var(--color-teal-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__success-icon svg {
  width: 26px;
  height: 26px;
}

.modal__success-title {
  font-size: 1.2rem;
  margin-bottom: var(--space-2xs);
}

.modal__success-desc {
  font-size: var(--text-small);
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

@media (prefers-reduced-motion: no-preference) {
  .modal {
    animation: modal-in var(--dur-fast) var(--ease-out);
  }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
