/* ==========================================================================
   Wafian modals — reusable vanilla modal shell + form/legal styling.
   Dark surface #1e1e1e, accent #25cc9d, Syne + DM Sans to match the site.
   ========================================================================== */

.waf-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 20px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  transition: opacity 220ms ease;
  -webkit-overflow-scrolling: touch;
}

.waf-modal-overlay.is-open {
  opacity: 1;
}

.waf-modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: auto;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 40px;
  color: #fff;
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition:
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 240ms ease;
}

.waf-modal-overlay.is-open .waf-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.waf-modal--wide {
  max-width: 760px;
}

@media (min-width: 768px) {
  .waf-modal {
    padding: 48px;
  }
}

/* Close button ----------------------------------------------------------- */
.waf-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #fff;
  line-height: 1;
  border-radius: 4px;
  transition: background-color 160ms ease;
}

.waf-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.waf-modal-close span {
  font-family: "Syne", Arial, sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
}

.waf-modal-close:focus-visible,
.waf-modal :focus-visible {
  outline: 2px solid #25cc9d;
  outline-offset: 2px;
}

/* Header (title + optional language toggle) ------------------------------ */
.waf-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding-right: 40px;
}

.waf-modal-title {
  font-family: "Syne", Arial, sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.66px;
  line-height: 1.1;
  color: #fff;
  margin: 0;
}

@media (min-width: 768px) {
  .waf-modal-title {
    font-size: 33px;
  }
}

.waf-modal-subtitle {
  font-family: "Syne", Arial, sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.32px;
  line-height: 26px;
  color: #fff;
  opacity: 0.6;
  margin: 0 0 32px;
}

@media (min-width: 768px) {
  .waf-modal-subtitle {
    font-size: 16px;
  }
}

/* EN / SR language toggle ------------------------------------------------ */
.waf-lang-toggle {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.waf-lang-option {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #fff;
  font-family: "Syne", Arial, sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.4px;
  padding: 6px 14px;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.waf-lang-option.is-active {
  background: #25cc9d;
  color: #1e1e1e;
}

/* Forms ------------------------------------------------------------------ */
.waf-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.waf-field {
  display: flex;
  flex-direction: column;
}

.waf-label {
  font-family: "Syne", Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.28px;
  color: #fff;
  opacity: 0.85;
  margin-bottom: 8px;
}

.waf-input,
.waf-textarea {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 14px 16px;
  color: #fff;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 16px;
  letter-spacing: -0.32px;
  outline: none;
  transition: border-color 180ms ease;
}

.waf-input::placeholder,
.waf-textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.waf-input:focus,
.waf-textarea:focus {
  border-color: #25cc9d;
}

.waf-textarea {
  resize: vertical;
  min-height: 132px;
}

/* Honeypot — visually and semantically hidden */
.waf-honeypot {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.waf-error {
  font-family: "DM Sans", Arial, sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #ff6b6b;
  margin: 0;
}

.waf-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #25cc9d;
  border: none;
  cursor: pointer;
  padding: 16px 24px;
  margin-top: 6px;
  font-family: "Syne", Arial, sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.32px;
  color: #1e1e1e;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.waf-submit:hover:not(:disabled) {
  background: #2de8b3;
  transform: translateY(-2px);
}

.waf-submit:disabled {
  opacity: 0.5;
  cursor: default;
}

.waf-submit--block {
  width: 100%;
}

/* Success state ---------------------------------------------------------- */
.waf-success-title {
  font-family: "Syne", Arial, sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: #25cc9d;
  margin: 0 0 12px;
}

.waf-success-text {
  font-family: "DM Sans", Arial, sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.3px;
  color: #fff;
  opacity: 0.6;
  margin: 0;
}

/* Legal / document body -------------------------------------------------- */
.waf-doc {
  max-height: min(62vh, 620px);
  overflow-y: auto;
  padding-right: 12px;
  margin-top: 8px;
}

.waf-doc-loading,
.waf-doc-empty {
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 15px;
  color: #fff;
  opacity: 0.6;
}

.waf-doc-error {
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 15px;
  color: #ff6b6b;
}

.waf-prose {
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}

.waf-prose h1,
.waf-prose h2,
.waf-prose h3,
.waf-prose h4 {
  font-family: "Syne", Arial, sans-serif;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin: 1.4em 0 0.5em;
}

.waf-prose h1 { font-size: 24px; }
.waf-prose h2 { font-size: 20px; }
.waf-prose h3 { font-size: 17px; }
.waf-prose h1:first-child,
.waf-prose h2:first-child,
.waf-prose h3:first-child { margin-top: 0; }

.waf-prose p,
.waf-prose ul,
.waf-prose ol {
  margin: 0 0 1em;
}

.waf-prose ul,
.waf-prose ol {
  padding-left: 1.3em;
}

.waf-prose li {
  margin-bottom: 0.4em;
}

.waf-prose a {
  color: #25cc9d;
  text-decoration: underline;
}

.waf-prose strong {
  color: #fff;
  font-weight: 700;
}

.waf-prose hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 1.5em 0;
}

.waf-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 3px;
}

/* Scrollbar for the doc pane */
.waf-doc::-webkit-scrollbar { width: 8px; }
.waf-doc::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

/* Footer newsletter inline form ----------------------------------------- */
.site-footer-newsletter {
  display: inline-block;
  margin: 4px auto 0;
  background: #25cc9d;
  border: none;
  cursor: pointer;
  padding: 12px 22px;
  font-family: "Syne", Arial, sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #1e1e1e;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.site-footer-newsletter:hover {
  background: #2de8b3;
  transform: translateY(-2px);
}

/* Trigger buttons styled as links (footer) ------------------------------- */
.site-footer-links button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #fff;
  font-family: "Syne", Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
}

.site-footer-links button:hover {
  text-decoration: underline;
}

/* Reduced motion --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .waf-modal-overlay,
  .waf-modal {
    transition: none;
  }
  .waf-modal {
    transform: none;
  }
  .waf-submit:hover:not(:disabled),
  .site-footer-newsletter:hover {
    transform: none;
  }
}

body.waf-modal-open {
  overflow: hidden;
}
