/* Support modal + toast. Self-contained so it can load on any page (index,
   covest, etc.) regardless of that page's own stylesheet. No inline styles,
   so it complies with the site CSP (style-src 'self'). */

:root {
  --sm-ink: #11264e;
  --sm-paper: #f8f4ea;
  --sm-line: #d4ccbd;
  --sm-muted: #5c6780;
  --sm-teal: #00a9c1;
  --sm-danger: #b23a48;
}

.sm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(16, 36, 75, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.sm-overlay.sm-open { opacity: 1; pointer-events: auto; }

.sm-dialog {
  width: min(560px, 100%);
  margin: auto;
  background: var(--sm-paper);
  color: var(--sm-ink);
  border: 1px solid var(--sm-line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(16, 36, 75, 0.28);
  font-family: Manrope, Arial, sans-serif;
  transform: translateY(-8px);
  transition: transform 0.18s ease;
}
.sm-overlay.sm-open .sm-dialog { transform: translateY(0); }

.sm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.sm-head h2 { margin: 0; font-size: 1.5rem; }
.sm-head p { margin: 6px 0 0; color: var(--sm-muted); font-size: 0.95rem; }
.sm-close {
  flex: none;
  width: 36px; height: 36px;
  border: 1px solid var(--sm-line);
  border-radius: 8px;
  background: transparent;
  font-size: 20px; line-height: 1;
  color: var(--sm-ink);
  cursor: pointer;
}
.sm-close:hover { background: rgba(16, 36, 75, 0.06); }

.sm-form { margin-top: 18px; }
.sm-form label { display: block; margin-top: 14px; font-weight: 600; font-size: 0.95rem; }
.sm-form input, .sm-form select, .sm-form textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px;
  font: inherit;
  color: var(--sm-ink);
  background: #fff;
  border: 1px solid var(--sm-line);
  border-radius: 8px;
}
.sm-form .sm-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.sm-form .sm-row label { margin-top: 0; }
.sm-form .cf-turnstile { margin-top: 16px; }
.sm-actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.sm-actions button[type="submit"] {
  background: var(--sm-ink);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 700;
  cursor: pointer;
}
.sm-actions button[disabled] { opacity: 0.5; cursor: not-allowed; }
.sm-hint { color: var(--sm-muted); font-size: 0.85rem; }

@media (max-width: 560px) {
  .sm-form .sm-row { grid-template-columns: 1fr; }
  .sm-dialog { padding: 22px; }
}

/* Transient confirmation toasts */
.sm-toasts {
  position: fixed;
  z-index: 1100;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100% - 32px));
}
.sm-toast {
  padding: 14px 16px;
  border-radius: 12px;
  color: #fff;
  font-family: Manrope, Arial, sans-serif;
  font-size: 0.95rem;
  box-shadow: 0 12px 30px rgba(16, 36, 75, 0.3);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.sm-toast.sm-show { opacity: 1; transform: translateY(0); }
.sm-toast.sm-ok { background: #1f7a5a; }
.sm-toast.sm-err { background: var(--sm-danger); }
.sm-toast a { color: #fff; text-decoration: underline; }
