/* ═══════════════════════════════════════════════════════
   WELCOME MODAL — Workfacilit
   Onboarding & site search overlay. No vertical/horizontal scroll.
   ═══════════════════════════════════════════════════════ */

/* ── Overlay ── */
.wf-wm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
}
.wf-wm-overlay.wf-wm--visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Modal container ── */
.wf-wm {
  position: relative;
  width: 100%;
  max-width: 880px;
  max-height: min(88vh, 680px);
  background: var(--wf-bg-glass, rgba(10, 10, 24, .94));
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, .65),
    0 0 0 1px rgba(99, 102, 241, .18),
    inset 0 1px 0 rgba(255, 255, 255, .06);
  transform: scale(.94) translateY(14px);
  opacity: 0;
  transition:
    transform 340ms cubic-bezier(.16, 1, .3, 1),
    opacity   280ms ease;
}
.wf-wm--visible .wf-wm {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ── Ambient gradient ── */
.wf-wm::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(99, 102, 241, .18) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
}

/* ════════════════════════════════
   HEADER
   ════════════════════════════════ */
.wf-wm__header {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 1.375rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  flex-shrink: 0;
}
.wf-wm__brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1;
  min-width: 0;
}
.wf-wm__logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}
.wf-wm__greeting {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.wf-wm__hi {
  font-size: .88rem;
  font-weight: 700;
  color: var(--wf-text-1, #f1f5f9);
  font-family: var(--wf-display, 'Plus Jakarta Sans', sans-serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.wf-wm__sub {
  font-size: .7rem;
  color: var(--wf-text-2, #94a3b8);
  font-weight: 500;
  margin-top: .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wf-wm__badge {
  display: none;
  align-items: center;
  gap: .3rem;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #a5b4fc;
  background: rgba(99, 102, 241, .14);
  border: 1px solid rgba(99, 102, 241, .3);
  border-radius: 20px;
  padding: .18rem .55rem;
  flex-shrink: 0;
  animation: wm-badge-pulse 2.8s ease infinite;
}
@keyframes wm-badge-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .55; }
}
.wf-wm__close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .1);
  background: transparent;
  color: var(--wf-text-2, #94a3b8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: .9rem;
  transition: background 180ms, color 180ms, border-color 180ms, transform 180ms;
}
.wf-wm__close:hover {
  background: rgba(255, 255, 255, .1);
  color: var(--wf-text-1, #f1f5f9);
  border-color: rgba(255, 255, 255, .22);
  transform: rotate(90deg);
}

/* ════════════════════════════════
   SEARCH BAR
   ════════════════════════════════ */
.wf-wm__search-wrap {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .625rem 1.375rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .018);
  flex-shrink: 0;
}
.wf-wm__search-icon {
  font-size: 1rem;
  color: var(--wf-text-3, #64748b);
  flex-shrink: 0;
  transition: color 180ms;
}
.wf-wm__search-wrap:focus-within .wf-wm__search-icon {
  color: #a5b4fc;
}
.wf-wm__search {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: .86rem;
  font-weight: 500;
  color: var(--wf-text-1, #f1f5f9);
  font-family: inherit;
  padding: .25rem 0;
}
.wf-wm__search::placeholder {
  color: var(--wf-text-3, #64748b);
  font-weight: 400;
}
.wf-wm__search-kbd {
  font-size: .63rem;
  color: var(--wf-text-3, #64748b);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 4px;
  padding: .1rem .4rem;
  font-family: monospace;
  flex-shrink: 0;
  transition: opacity 200ms;
}
.wf-wm__search-wrap:focus-within .wf-wm__search-kbd {
  opacity: 0;
}
.wf-wm__clear {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .09);
  color: var(--wf-text-2, #94a3b8);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  flex-shrink: 0;
  transition: background 150ms;
}
.wf-wm__clear:hover   { background: rgba(255, 255, 255, .16); }
.wf-wm__clear--visible { display: flex; }

/* ════════════════════════════════
   BODY
   ════════════════════════════════ */
.wf-wm__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: .875rem 1.375rem;
  min-height: 0;
}

/* ── Agentic highlight banner ── */
.wf-wm__agentic {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .7rem 1rem;
  background: linear-gradient(135deg,
    rgba(99, 102, 241, .18) 0%,
    rgba(139, 92, 246, .11) 100%);
  border: 1px solid rgba(99, 102, 241, .3);
  border-radius: 12px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.wf-wm__agentic::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 0% 50%, rgba(99, 102, 241, .14) 0%, transparent 65%);
  pointer-events: none;
}
.wf-wm__ag-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  animation: wm-brain 3.2s ease infinite;
}
@keyframes wm-brain {
  0%, 100% { box-shadow: 0 0 0 0   rgba(99, 102, 241, 0); }
  50%       { box-shadow: 0 0 0 7px rgba(99, 102, 241, .22); }
}
.wf-wm__ag-text { flex: 1; min-width: 0; }
.wf-wm__ag-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--wf-text-1, #f1f5f9);
  font-family: var(--wf-display, sans-serif);
  line-height: 1.2;
}
.wf-wm__ag-sub {
  font-size: .67rem;
  color: var(--wf-text-2, #94a3b8);
  margin-top: .1rem;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wf-wm__ag-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 600;
  color: #a5b4fc;
  background: rgba(99, 102, 241, .15);
  border: 1px solid rgba(99, 102, 241, .35);
  border-radius: 8px;
  padding: .32rem .72rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 180ms, color 180ms, border-color 180ms;
}
.wf-wm__ag-btn:hover {
  background: rgba(99, 102, 241, .3);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, .55);
}

/* ── Content grid (categories) ── */
.wf-wm__grid-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}
.wf-wm__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  height: 100%;
}
.wf-wm__col {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-height: 0;
}
.wf-wm__col-label {
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--wf-text-3, #64748b);
  padding: 0 .5rem .35rem;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  margin-bottom: .25rem;
  flex-shrink: 0;
}

/* Link items */
.wf-wm__link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .32rem .5rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--wf-text-2, #94a3b8);
  border: 1px solid transparent;
  transition: background 150ms, color 150ms, border-color 150ms;
  animation: wm-link-in 250ms ease both;
}
@keyframes wm-link-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.wf-wm__link:hover {
  background: rgba(255, 255, 255, .055);
  color: var(--wf-text-1, #f1f5f9);
  border-color: rgba(255, 255, 255, .08);
}
.wf-wm__link-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .76rem;
  flex-shrink: 0;
  background: rgba(99, 102, 241, .1);
  color: #a5b4fc;
}
.wf-wm__link-name {
  font-size: .76rem;
  font-weight: 600;
  line-height: 1;
  color: inherit;
}

/* ── Search results ── */
.wf-wm__results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .4rem;
  align-content: start;
  height: 100%;
}
.wf-wm__no-results {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--wf-text-3, #64748b);
  font-size: .82rem;
  padding: 1.75rem 1rem;
  line-height: 1.7;
}
.wf-wm__no-results i {
  font-size: 1.6rem;
  display: block;
  margin-bottom: .5rem;
  opacity: .3;
}
.wf-wm__result-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .42rem .6rem;
  border-radius: 9px;
  text-decoration: none;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .07);
  color: var(--wf-text-2, #94a3b8);
  transition: background 150ms, border-color 150ms, color 150ms;
  animation: wm-link-in 180ms ease both;
}
.wf-wm__result-item:hover {
  background: rgba(99, 102, 241, .12);
  border-color: rgba(99, 102, 241, .3);
  color: var(--wf-text-1, #f1f5f9);
}
.wf-wm__result-icon {
  font-size: .85rem;
  color: #a5b4fc;
  flex-shrink: 0;
}
.wf-wm__result-name {
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wf-wm__result-desc {
  font-size: .65rem;
  color: var(--wf-text-3, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
mark.wf-hl {
  background: rgba(99, 102, 241, .35);
  color: #c7d2fe;
  border-radius: 3px;
  padding: 0 2px;
}

/* ════════════════════════════════
   FOOTER
   ════════════════════════════════ */
.wf-wm__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 1.375rem;
  border-top: 1px solid rgba(255, 255, 255, .07);
  background: rgba(0, 0, 0, .18);
  flex-shrink: 0;
}
.wf-wm__no-show {
  display: flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
  font-size: .72rem;
  color: var(--wf-text-3, #64748b);
  user-select: none;
  transition: color 150ms;
}
.wf-wm__no-show:hover { color: var(--wf-text-2, #94a3b8); }
.wf-wm__no-show input[type="checkbox"] {
  accent-color: #6366f1;
  width: 13px;
  height: 13px;
  cursor: pointer;
}
.wf-wm__demo-btn {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  font-size: .76rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 8px;
  padding: .4rem .9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 180ms, transform 180ms;
}
.wf-wm__demo-btn:hover {
  opacity: .9;
  transform: translateY(-1px);
}

/* ── Cases de Sucesso strip ── */
.wf-wm__cases {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .62rem 1.375rem;
  background: linear-gradient(135deg,
    rgba(245, 158, 11, .13) 0%,
    rgba(251, 191, 36, .07) 100%);
  border-top: 1px solid rgba(245, 158, 11, .22);
  border-bottom: 1px solid rgba(245, 158, 11, .22);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 180ms;
}
.wf-wm__cases:hover {
  background: linear-gradient(135deg,
    rgba(245, 158, 11, .22) 0%,
    rgba(251, 191, 36, .13) 100%);
}
.wf-wm__cases-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  color: #fff;
  flex-shrink: 0;
}
.wf-wm__cases-text {
  display: flex;
  flex-direction: column;
  gap: .05rem;
  flex: 1;
  min-width: 0;
}
.wf-wm__cases-title {
  font-size: .77rem;
  font-weight: 700;
  color: var(--wf-text-1, #f1f5f9);
  font-family: var(--wf-display, sans-serif);
  line-height: 1.2;
}
.wf-wm__cases-sub {
  font-size: .67rem;
  color: #fbbf24;
  opacity: .8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wf-wm__cases-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .71rem;
  font-weight: 600;
  color: #fbbf24;
  background: rgba(245, 158, 11, .15);
  border: 1px solid rgba(245, 158, 11, .35);
  border-radius: 7px;
  padding: .28rem .65rem;
  white-space: nowrap;
  transition: background 180ms, border-color 180ms;
}
.wf-wm__cases:hover .wf-wm__cases-cta {
  background: rgba(245, 158, 11, .28);
  border-color: rgba(245, 158, 11, .55);
}

/* ════════════════════════════════
   LIGHT THEME
   ════════════════════════════════ */
[data-theme="light"] .wf-wm {
  background: rgba(255, 255, 255, .97);
  border-color: rgba(0, 0, 0, .07);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, .18),
    0 0 0 1px rgba(99, 102, 241, .15);
}
[data-theme="light"] .wf-wm-overlay { background: rgba(0, 0, 0, .42); }
[data-theme="light"] .wf-wm__hi    { color: #0f172a; }
[data-theme="light"] .wf-wm__sub   { color: #475569; }
[data-theme="light"] .wf-wm__col-label { color: #94a3b8; }
[data-theme="light"] .wf-wm__link  { color: #475569; }
[data-theme="light"] .wf-wm__link:hover {
  background: rgba(0, 0, 0, .04);
  color: #0f172a;
  border-color: rgba(0, 0, 0, .08);
}
[data-theme="light"] .wf-wm__result-item {
  background: rgba(0, 0, 0, .025);
  border-color: rgba(0, 0, 0, .07);
  color: #475569;
}
[data-theme="light"] .wf-wm__result-item:hover { color: #0f172a; }
[data-theme="light"] .wf-wm__no-show  { color: #94a3b8; }
[data-theme="light"] .wf-wm__search   { color: #0f172a; }
[data-theme="light"] .wf-wm__search-kbd {
  background: rgba(0, 0, 0, .05);
  border-color: rgba(0, 0, 0, .1);
  color: #94a3b8;
}
[data-theme="light"] .wf-wm__close {
  color: #64748b;
  border-color: rgba(0, 0, 0, .12);
}
[data-theme="light"] .wf-wm__close:hover {
  background: rgba(0, 0, 0, .06);
  color: #0f172a;
}
[data-theme="light"] .wf-wm__link-icon {
  background: rgba(99, 102, 241, .08);
}
[data-theme="light"] .wf-wm__footer {
  background: rgba(0, 0, 0, .02);
  border-top-color: rgba(0, 0, 0, .07);
}
[data-theme="light"] .wf-wm__header,
[data-theme="light"] .wf-wm__search-wrap {
  border-color: rgba(0, 0, 0, .07);
}
[data-theme="light"] .wf-wm__agentic {
  background: linear-gradient(135deg,
    rgba(99, 102, 241, .09) 0%,
    rgba(139, 92, 246, .06) 100%);
  border-color: rgba(99, 102, 241, .25);
}

/* ════════════════════════════════
   RESPONSIVE
   ════════════════════════════════ */
@media (max-width: 640px) {
  .wf-wm-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .wf-wm {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .wf-wm__grid,
  .wf-wm__results {
    grid-template-columns: 1fr 1fr;
  }
  .wf-wm__col:last-child { display: none; }
  .wf-wm__ag-sub { display: none; }
  .wf-wm__badge  { display: none !important; }
}
@media (max-width: 420px) {
  .wf-wm__grid,
  .wf-wm__results { grid-template-columns: 1fr; }
}
