/* Welcome / Open-Beta consent popup.
   Consumes the canonical design tokens from static/css/sphragio-tokens.css
   (linked before this file in base.html) so the modal matches the site:
   Poppins type, --navy brand colour, token radii/shadows, pale app-style
   cards. Refreshed 2026-06-19 — lighter, airier, aligned to the web app. */

.sph-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 13, 90, 0.42);
  backdrop-filter: blur(6px) saturate(1.1);
  -webkit-backdrop-filter: blur(6px) saturate(1.1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 0s linear 220ms;
  font-family: var(--font-family, 'Poppins', system-ui, sans-serif);
}
.sph-modal-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 220ms ease;
}

.sph-modal {
  background: #ffffff;
  border: 1px solid rgba(28, 13, 90, 0.06);
  border-radius: 20px;
  box-shadow: 0 24px 64px -16px rgba(28, 13, 90, 0.28), 0 4px 12px rgba(28, 13, 90, 0.06);
  max-width: 540px;
  width: 100%;
  padding: 2.5rem 2.5rem 2rem;
  box-sizing: border-box;
  transform: translateY(14px) scale(0.98);
  opacity: 0;
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 280ms ease;
  max-height: 92vh;
  overflow-y: auto;
}
.sph-modal-overlay.is-visible .sph-modal { transform: translateY(0) scale(1); opacity: 1; }

.sph-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg, 16px);
  background: linear-gradient(145deg, var(--indigo-50, #EFF1FB), #ffffff);
  box-shadow: inset 0 0 0 1px var(--indigo-100, #DCE0F6);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.4rem;
}
.sph-icon svg { width: 26px; height: 26px; }

.sph-title {
  font-size: 1.625rem;
  font-weight: var(--weight-bold, 700);
  color: var(--navy, #1C0D5A);
  margin: 0 0 0.7rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.sph-text {
  font-size: var(--text-sm, 15px);
  line-height: 1.62;
  color: var(--gray-700, #3A4A5C);
  margin: 0 0 0.9rem;
}
.sph-text:last-of-type { margin-bottom: 0; }
.sph-text strong { color: var(--navy, #1C0D5A); font-weight: var(--weight-semibold, 600); }
.sph-text a      { color: var(--navy-light, #295CFF); font-weight: var(--weight-medium, 500); text-decoration: none; }
.sph-text a:hover{ text-decoration: underline; }

/* Info cards — pale, fully-rounded, hairline-bordered. Lighter than the old
   saturated left-border banners; the emoji in the title carries the colour. */
.sph-highlight {
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
  margin: 1.25rem 0 0;
  border: 1px solid transparent;
}
.sph-highlight + .sph-highlight { margin-top: 0.7rem; }
.sph-highlight-amber  { background: #FFF8EE; border-color: #F1E2C5; }
.sph-highlight-purple { background: #F5F6FD; border-color: #E2E6F6; }
.sph-highlight-info   { background: #F1F8FD; border-color: #D8E8F4; }

.sph-highlight-title {
  font-size: var(--text-sm, 14px);
  font-weight: var(--weight-semibold, 600);
  color: var(--navy, #1C0D5A);
  margin: 0 0 4px;
  line-height: 1.4;
}
.sph-highlight-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--gray-700, #3A4A5C);
  margin: 0;
}
.sph-highlight-body a {
  color: var(--navy-light, #295CFF);
  font-weight: var(--weight-semibold, 600);
  text-decoration: none;
}
.sph-highlight-body a:hover { text-decoration: underline; }

.sph-consent {
  margin-top: 1.5rem;
  padding: 14px 16px;
  border: 1.5px solid var(--indigo-100, #DCE0F6);
  border-radius: var(--radius-md, 12px);
  background: var(--indigo-50, #EFF1FB);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sph-consent:focus-within { border-color: var(--navy-light, #295CFF); background: #F7F8FE; }
.sph-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: var(--text-sm, 14px);
  line-height: 1.55;
  color: var(--gray-900, #1A2332);
  font-weight: var(--weight-medium, 500);
  cursor: pointer;
}
.sph-consent-box {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--navy-light, #295CFF);
  cursor: pointer;
}
.sph-consent-label a { color: var(--navy-light, #295CFF); font-weight: var(--weight-semibold, 600); text-decoration: underline; }
.sph-consent-label a:hover { color: var(--navy, #1C0D5A); }

/* Primary CTA — mirrors the site's .btn-primary (navy → navy-light on hover). */
.sph-btn {
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius-md, 12px);
  font-size: var(--text-base, 16px);
  font-weight: var(--weight-semibold, 600);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  font-family: inherit;
  background: var(--navy, #1C0D5A);
  color: #ffffff;
  border: none;
  margin-top: 1.4rem;
  line-height: 1.2;
  box-shadow: 0 6px 16px -6px rgba(28, 13, 90, 0.45);
}
.sph-btn:hover  { background: var(--navy-light, #295CFF); transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(41, 92, 255, 0.5); }
.sph-btn:active { transform: translateY(0); }
.sph-btn:disabled {
  background: var(--gray-200, #D0DAE8);
  color: #ffffff;
  cursor: not-allowed;
  opacity: 0.85;
  transform: none;
  box-shadow: none;
}

@media (max-width: 640px) {
  .sph-modal { padding: 1.75rem 1.4rem 1.4rem; border-radius: 18px; }
  .sph-title { font-size: 1.375rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sph-modal-overlay,
  .sph-modal,
  .sph-btn { transition: opacity 120ms ease; }
  .sph-modal { transform: none; }
  .sph-btn:hover { transform: none; }
}

/* Fail-closed no-JS gate (Qodo #1): styled via the stylesheet (loads without
   JS), so the <noscript> overlay covers the page and blocks interaction when
   JavaScript is disabled. */
.sph-noscript {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(28, 13, 90, 0.85);
  font-family: var(--font-family, 'Poppins', system-ui, sans-serif);
}
.sph-noscript-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 64px -16px rgba(28, 13, 90, 0.28);
  max-width: 460px;
  width: 100%;
  padding: 2rem;
  box-sizing: border-box;
}
.sph-noscript-title {
  font-size: 20px;
  font-weight: var(--weight-bold, 700);
  color: var(--navy, #1C0D5A);
  margin: 0 0 0.75rem;
  line-height: 1.3;
}
.sph-noscript-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-700, #3A4A5C);
  margin: 0;
}
.sph-noscript-text a { color: var(--navy-light, #295CFF); font-weight: var(--weight-semibold, 600); text-decoration: none; }
.sph-noscript-text a:hover { text-decoration: underline; }
