/* ============================================================
   Overlays: modals and toasts
   ============================================================ */

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--overlay-menu);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.close-modal-btn {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  flex-shrink: 0;
}

.close-modal-btn:hover {
  color: var(--text-primary);
  background: var(--overlay-soft);
}

.modal-body { padding: 18px 20px; }

.modal-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.api-guide-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 16px;
  font-size: 0.82rem;
}

.api-guide-box strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px;
}

.api-guide-box p {
  color: var(--text-muted);
  margin-bottom: 10px;
}

.api-guide-box code {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  background: var(--overlay-soft);
  border: 1px solid var(--border-muted);
  border-radius: 4px;
  padding: 0 5px;
}

.link-btn {
  color: var(--accent-primary);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.8rem;
  display: inline-block;
}

.link-btn:hover {
  color: var(--accent-highlight);
  text-decoration: underline;
}

.modal-footer {
  padding: 14px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-muted);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---- Toasts: status colors via tokens ---- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  background: var(--overlay-menu);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-pop);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.2s ease-out, fadeOut 0.3s ease 2.7s forwards;
}

.toast.success { border-color: var(--status-ok-border); }
.toast.error { border-color: var(--status-bad-border); }

@keyframes slideInRight {
  from { transform: translateX(16px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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