/* modal.css — Overlays and modal dialogs */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: modal-fade .15s ease;
}
.modal-overlay.hidden { display: none; }

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-up   { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 500px;
  max-width: calc(100vw - 32px);
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  animation: modal-up .2s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);
}

.modal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-h h3 {
  font-family: var(--font-display, sans-serif);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--fg);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Form fields inside modals */
.modal-body label {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 4px;
  margin-top: 14px;
}
.modal-body label:first-child { margin-top: 0; }

.modal-body input,
.modal-body textarea,
.modal-body select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-family: var(--font-ui, sans-serif);
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  transition: border-color .15s;
}
.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus { border-color: var(--accent); }
.modal-body textarea { resize: vertical; min-height: 80px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--fg);
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  z-index: 2000;
  animation: modal-up .2s ease;
  white-space: nowrap;
}
.toast.ok   { border-color: var(--ok);       color: var(--ok); }
.toast.warn { border-color: var(--warn);     color: var(--warn); }
.toast.err  { border-color: var(--critical); color: var(--critical); }
