.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 7, 13, 0.74);
  backdrop-filter: blur(8px);
  animation: modalFadeIn 0.22s ease;
}

.modal-content {
  position: relative;
  width: min(520px, 100%);
  padding: 42px;
  text-align: center;
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at 85% 10%, rgba(212, 175, 55, 0.10), transparent 32%),
    linear-gradient(180deg, rgba(22, 34, 56, 0.98), rgba(5, 7, 13, 0.98));
  box-shadow: var(--hm-shadow);
  animation: modalScaleUp 0.24s ease forwards;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 16px;
  border: 0;
  background: transparent;
  color: var(--hm-muted);
  font-size: 2rem;
  cursor: pointer;
  transition: color 160ms ease;
}

.close-button:hover {
  color: var(--hm-text);
}

.modal-content h3 {
  margin: 0;
  color: var(--hm-gold-bright);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.modal-content p {
  margin: 16px 0 28px;
  color: var(--hm-muted);
}

.modal-form {
  display: flex;
  gap: 10px;
}

.modal-form input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--hm-border);
  background: rgba(5, 7, 13, 0.56);
  color: var(--hm-text);
  outline: none;
}

.modal-form input:focus {
  border-color: var(--hm-border-strong);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.08);
}

.modal-form button {
  white-space: nowrap;
}

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

@keyframes modalScaleUp {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 620px) {
  .modal-content {
    padding: 34px 22px;
  }

  .modal-form {
    flex-direction: column;
  }
}

/* ================================
   Private Portfolio Gatekeeper Modal
   Used by portfolios-toggle.js
   ================================ */

#gatekeeper-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(5, 7, 13, 0.82);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 240ms ease;
}

#gatekeeper-modal.active {
  display: flex !important;
  opacity: 1 !important;
}

#gatekeeper-modal .modal-content {
  width: min(650px, 100%);
  padding: 42px;
  text-align: center;
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at 85% 10%, rgba(212, 175, 55, 0.10), transparent 32%),
    linear-gradient(180deg, rgba(22, 34, 56, 0.98), rgba(5, 7, 13, 0.98));
  box-shadow: var(--hm-shadow);
  color: var(--hm-text);
}

#gatekeeper-modal .modal-form {
  display: block;
}

#gatekeeper-modal .modal-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--hm-border);
  background: rgba(5, 7, 13, 0.56);
  color: var(--hm-text);
  outline: none;
}

#gatekeeper-modal .modal-form input:focus {
  border-color: var(--hm-border-strong);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.08);
}