/* ============================================================
   shared/usad-overlays.css — styles for USAD.modal + USAD.toast
   Brand-compliant: never red on blue. Uses design.css tokens.
   ============================================================ */

/* ── Modal ──────────────────────────────────────────────── */
.usad-modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(13, 16, 64, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .12s ease;
}
.usad-modal-overlay.open { opacity: 1; }
body.usad-modal-active { overflow: hidden; }

.usad-modal {
  background: var(--surface, #fff);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 24px 64px rgba(13,16,64,.35), 0 2px 8px rgba(13,16,64,.18);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  font-family: var(--font-ui, 'Inter', system-ui, sans-serif);
  color: var(--ink, #0d1117);
  transform: translateY(8px) scale(.98);
  transition: transform .14s ease;
}
.usad-modal-overlay.open .usad-modal {
  transform: translateY(0) scale(1);
}

.usad-modal-head {
  padding: 18px 22px 12px;
  border-bottom: 1px solid var(--line, #e2e5ef);
}
.usad-modal-title {
  font-family: var(--font-display, 'Barlow Condensed', Arial, sans-serif);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--brand-blue, #171f69);
  margin: 0;
  line-height: 1.15;
}

.usad-modal-body {
  padding: 18px 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2, #2d3a4a);
  overflow-y: auto;
  flex: 1;
}
.usad-modal-body p { margin: 0 0 10px; }
.usad-modal-body p:last-child { margin-bottom: 0; }
.usad-modal-body code {
  font-family: var(--font-mono, 'JetBrains Mono', Consolas, monospace);
  font-size: 12.5px;
  background: var(--surface-2, #f7f8fc);
  padding: 1px 5px;
  border-radius: 4px;
}

.usad-modal-prompt { display: flex; flex-direction: column; gap: 10px; }
.usad-modal-prompt-body { font-size: 14px; color: var(--ink-2); }
.usad-modal-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface-2, #f7f8fc);
  border: 1px solid var(--line, #e2e5ef);
  border-radius: var(--radius, 6px);
  transition: border-color .12s, box-shadow .12s;
}
.usad-modal-input:focus {
  outline: none;
  border-color: var(--brand-pool, #009ac7);
  box-shadow: 0 0 0 3px rgba(0,154,199,.18);
}
.usad-modal-error {
  font-size: 12px;
  color: var(--brand-red, #e31937);
  min-height: 1.2em;
  display: none;
}
.usad-modal-error.show { display: block; }

.usad-modal-foot {
  padding: 14px 22px 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid var(--line, #e2e5ef);
  background: var(--surface-2, #f7f8fc);
  border-radius: 0 0 var(--radius-lg, 12px) var(--radius-lg, 12px);
}
.usad-modal-btn {
  height: 36px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  border-radius: var(--radius, 6px);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, box-shadow .12s;
}
.usad-modal-btn.secondary {
  background: var(--surface, #fff);
  color: var(--ink-2, #2d3a4a);
  border-color: var(--line, #e2e5ef);
}
.usad-modal-btn.secondary:hover {
  background: var(--surface-2, #f7f8fc);
  color: var(--ink, #0d1117);
}
.usad-modal-btn.primary {
  background: var(--brand-blue, #171f69);
  color: #fff;
}
.usad-modal-btn.primary:hover {
  background: var(--brand-blue-700, #1e2d8a);
}
.usad-modal-btn.danger {
  background: var(--brand-red, #e31937);
  color: #fff;
}
.usad-modal-btn.danger:hover {
  background: #c11530;
}
.usad-modal-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,154,199,.32);
}

/* Wider modal variant */
.usad-modal.wide { max-width: 720px; }
.usad-modal.xwide { max-width: 960px; }


/* ── Toast ──────────────────────────────────────────────── */
.usad-toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9500;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}
.usad-toast {
  pointer-events: auto;
  min-width: 220px;
  max-width: 360px;
  padding: 11px 14px;
  border-radius: var(--radius, 6px);
  background: var(--brand-blue-900, #0d1040);
  color: #fff;
  font-family: var(--font-ui, 'Inter', system-ui, sans-serif);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(13,16,64,.28), 0 2px 6px rgba(13,16,64,.18);
  transform: translateY(8px);
  opacity: 0;
  transition: opacity .14s, transform .14s;
  cursor: pointer;
  border-left: 3px solid var(--brand-pool, #009ac7);
}
.usad-toast.show { opacity: 1; transform: translateY(0); }
.usad-toast-success { border-left-color: var(--status-direct, #059669); }
.usad-toast-warn    { border-left-color: var(--status-replace, #d97706); }
.usad-toast-error   { border-left-color: var(--brand-red, #e31937); }
.usad-toast-info    { border-left-color: var(--brand-pool, #009ac7); }
