:root {
  --venim-ink: #141824;
  --venim-muted: #737c91;
  --venim-line: #e5e8ef;
  --venim-soft: #f5f6fa;
  --venim-surface: #ffffff;
  --venim-primary: #6b5ce7;
  --venim-primary-dark: #5546cf;
  --venim-mint: #38c7aa;
  --venim-night: #111522;
  --venim-warn: #d59c28;
  --venim-shadow: 0 18px 55px rgba(24, 31, 51, .09);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  background: var(--venim-soft);
  color: var(--venim-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--venim-primary); text-decoration: none; }
a:hover { color: var(--venim-primary-dark); }

.venim-brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--venim-ink);
  font-weight: 800;
  letter-spacing: -.04em;
  font-size: 1.35rem;
}
.venim-brand:hover { color: var(--venim-ink); }
.venim-mark {
  width: 31px;
  height: 31px;
  border-radius: 11px;
  position: relative;
  background: var(--venim-night);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.venim-mark::before, .venim-mark::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  top: 11px;
}
.venim-mark::before { left: 7px; background: var(--venim-primary); }
.venim-mark::after { right: 7px; background: var(--venim-mint); }

.btn-venim {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--venim-primary);
  --bs-btn-border-color: var(--venim-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--venim-primary-dark);
  --bs-btn-hover-border-color: var(--venim-primary-dark);
  --bs-btn-active-bg: var(--venim-primary-dark);
  --bs-btn-active-border-color: var(--venim-primary-dark);
  border-radius: 14px;
  font-weight: 700;
  padding: .72rem 1rem;
}
.btn-soft {
  background: #fff;
  border: 1px solid var(--venim-line);
  color: var(--venim-ink);
  border-radius: 14px;
  font-weight: 650;
}
.btn-soft:hover { border-color: #cfd4df; background: #fafbfc; }

.form-control, .form-select {
  min-height: 48px;
  border-radius: 14px;
  border-color: var(--venim-line);
  background-color: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: rgba(107,92,231,.55);
  box-shadow: 0 0 0 .22rem rgba(107,92,231,.11);
}
.form-check-input:checked { background-color: var(--venim-primary); border-color: var(--venim-primary); }

.venim-nav {
  min-height: 72px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(229,232,239,.85);
}

.surface {
  background: var(--venim-surface);
  border: 1px solid var(--venim-line);
  border-radius: 22px;
  box-shadow: 0 8px 30px rgba(24,31,51,.04);
}
.surface-flat { box-shadow: none; }

.hero-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 12%, rgba(107,92,231,.14), transparent 28%),
    radial-gradient(circle at 80% 78%, rgba(56,199,170,.13), transparent 30%),
    #f8f9fc;
}
.hero-title {
  max-width: 760px;
  font-size: clamp(3rem, 7vw, 6.5rem);
  letter-spacing: -.065em;
  line-height: .94;
  font-weight: 820;
}
.hero-sub {
  max-width: 590px;
  color: var(--venim-muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(229,232,239,.95);
  border-radius: 999px;
  padding: .55rem .8rem;
  font-size: .84rem;
  font-weight: 700;
  color: #4d5569;
}
.hero-orbit {
  min-height: 470px;
  position: relative;
  isolation: isolate;
}
.orbit-card {
  position: absolute;
  width: min(360px, 82%);
  border-radius: 27px;
  border: 1px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(20px);
  box-shadow: var(--venim-shadow);
  padding: 1.15rem;
}
.orbit-card.one { left: 7%; top: 11%; transform: rotate(-4deg); }
.orbit-card.two { right: 2%; top: 43%; transform: rotate(5deg); }
.orbit-glow {
  position: absolute;
  inset: 18% 13%;
  background: linear-gradient(145deg, rgba(107,92,231,.45), rgba(56,199,170,.38));
  filter: blur(60px);
  border-radius: 50%;
  z-index: -1;
}
.avatar-dot {
  width: 44px; height: 44px; border-radius: 16px;
  display: grid; place-items: center;
  background: #eef0ff; color: var(--venim-primary); font-weight: 800;
}
.avatar-dot.mint { background: #e8fbf6; color: #199878; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: min(470px, 100%); padding: clamp(1.5rem, 4vw, 2.35rem); }
.auth-note { color: var(--venim-muted); font-size: .9rem; }

.app-main { padding-top: 98px; padding-bottom: 45px; }
.app-kicker { color: var(--venim-muted); font-size: .82rem; font-weight: 750; text-transform: uppercase; letter-spacing: .12em; }
.app-title { font-weight: 800; letter-spacing: -.045em; }

.filter-bar { padding: .9rem; }
.filter-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: .65rem; }

.intent-card {
  border: 1px solid var(--venim-line);
  border-radius: 19px;
  background: #fff;
  padding: 1rem;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.intent-card:hover { transform: translateY(-2px); border-color: #d5d9e4; box-shadow: 0 12px 30px rgba(24,31,51,.07); }
.intent-title { font-size: 1.05rem; font-weight: 780; letter-spacing: -.02em; }
.intent-meta { color: var(--venim-muted); font-size: .86rem; }
.intent-desc { color: #4e5668; line-height: 1.55; font-size: .92rem; }
.category-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .75rem; font-weight: 750; color: #5347b7;
  background: #f0efff; border-radius: 999px; padding: .35rem .6rem;
}
.now-dot { width: 7px; height: 7px; background: var(--venim-mint); border-radius: 50%; box-shadow: 0 0 0 5px rgba(56,199,170,.12); }

.view-toggle { background: #eceef4; padding: 4px; border-radius: 13px; display: inline-flex; }
.view-toggle button { border: 0; background: transparent; border-radius: 10px; padding: .45rem .72rem; font-weight: 700; color: #677084; }
.view-toggle button.active { background: #fff; color: var(--venim-ink); box-shadow: 0 3px 10px rgba(30,36,55,.08); }

#map { width: 100%; height: 570px; border-radius: 20px; overflow: hidden; border: 1px solid var(--venim-line); }
.leaflet-popup-content-wrapper { border-radius: 15px; }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--venim-muted); }
.empty-icon { width: 58px; height: 58px; border-radius: 19px; display:grid; place-items:center; margin:0 auto 1rem; background:#eeeff7; color:var(--venim-primary); font-size:1.25rem; }

.chat-shell { height: calc(100vh - 100px); overflow: hidden; }
.conversation-list { height: 100%; overflow-y: auto; border-right: 1px solid var(--venim-line); }
.conversation-item { width: 100%; text-align: left; border: 0; border-bottom: 1px solid #f0f1f5; background: transparent; padding: 1rem; }
.conversation-item:hover, .conversation-item.active { background: #f7f7fc; }
.chat-panel { height: 100%; display: flex; flex-direction: column; }
.chat-head { min-height: 72px; border-bottom: 1px solid var(--venim-line); padding: .85rem 1rem; display: flex; align-items: center; justify-content: space-between; }
.chat-feed { flex: 1; overflow-y: auto; padding: 1rem; background: #f8f9fc; }
.bubble-row { display: flex; margin-bottom: .55rem; }
.bubble-row.me { justify-content: flex-end; }
.bubble { max-width: min(78%, 540px); padding: .72rem .9rem; border-radius: 17px 17px 17px 5px; background: #fff; border: 1px solid var(--venim-line); line-height: 1.45; box-shadow: 0 3px 11px rgba(25,32,50,.03); }
.bubble-row.me .bubble { background: var(--venim-night); color: #fff; border-color: var(--venim-night); border-radius: 17px 17px 5px 17px; }
.chat-compose { border-top: 1px solid var(--venim-line); padding: .8rem; background: #fff; }
.chat-compose .form-control { min-height: 46px; }
.chat-safety { font-size: .74rem; color: var(--venim-muted); }

.status-toast { position: fixed; right: 20px; bottom: 20px; z-index: 2000; max-width: 360px; }
.modal-content, .offcanvas { border: 0; border-radius: 24px; }
.modal-header, .modal-footer { border-color: var(--venim-line); }

@media (max-width: 991.98px) {
  .hero-orbit { min-height: 380px; margin-top: 2rem; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .filter-grid .wide { grid-column: span 2; }
  #map { height: 500px; }
  .chat-shell { height: calc(100vh - 88px); border-radius: 0; border-left:0; border-right:0; }
  .conversation-list { border-right: 0; }
  .mobile-hidden { display: none !important; }
}

@media (max-width: 575.98px) {
  .hero-title { font-size: 3.4rem; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-grid .wide { grid-column: auto; }
  .app-main { padding-top: 87px; }
  .orbit-card { width: 90%; }
  .orbit-card.one { left: 0; }
  .orbit-card.two { right: 0; }
}

.btn-location {
  border: 0;
  background: #eeefff;
  color: #5546cf;
  border-radius: 999px;
  font-weight: 750;
  padding: .38rem .7rem;
}
.btn-location:hover { background: #e4e2ff; color: #493bbf; }
.btn-location:disabled { opacity: .6; }

/* Confiança, filtros e check-in */
.filter-grid-expanded {
  grid-template-columns: 1.25fr .85fr 1.15fr 1fr 1fr auto;
  align-items: end;
}
.filter-field { min-width: 0; }
.filter-label {
  display: block;
  margin: 0 0 .35rem .15rem;
  color: var(--venim-muted);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .04em;
}
.age-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: .4rem; align-items: center; }
.age-range span { color: var(--venim-muted); font-size: .8rem; }
.age-range .form-control { min-width: 0; }
.filter-refresh { min-height: 48px; align-self: end; }
.intent-actions { gap: .45rem; }

.trust-alert {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1rem;
  border: 1px solid #e5d8a8;
  background: #fff9e9;
  color: #625321;
  border-radius: 16px;
}
.trust-alert > i { margin-top: .15rem; }
.trust-summary {
  padding: .85rem;
  border-radius: 16px;
  border: 1px solid var(--venim-line);
  background: #f8f8fc;
}
.trust-summary > div > i { color: var(--venim-primary); }

.encounter-panel {
  border-bottom: 1px solid var(--venim-line);
  background: #fbfbfe;
  padding: .7rem .9rem;
}
.encounter-card {
  border: 1px solid #dedff0;
  background: #fff;
  border-radius: 16px;
  padding: .85rem;
}
.encounter-kicker {
  color: #5b51ba;
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .08em;
  font-weight: 800;
  margin-bottom: .2rem;
}
.checkin-code-wrap {
  min-width: 104px;
  text-align: center;
  padding: .45rem .7rem;
  background: #f0efff;
  border-radius: 13px;
}
.checkin-code-wrap span {
  display: block;
  color: #716ba1;
  font-size: .65rem;
  text-transform: uppercase;
  font-weight: 750;
  letter-spacing: .06em;
}
.checkin-code-wrap strong { color: #4f43b4; font-size: 1.1rem; letter-spacing: .12em; }
.encounter-hint { color: var(--venim-muted); font-size: .78rem; line-height: 1.45; }
.checkin-states { display: flex; flex-wrap: wrap; gap: .5rem; }
.checkin-states span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 999px;
  background: #f2f3f7;
  color: #747b8a;
  padding: .32rem .55rem;
  font-size: .72rem;
  font-weight: 650;
}
.checkin-states span.done { background: #eaf8f4; color: #277965; }
.encounter-checkin { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin-top: .7rem; }
.encounter-checkin .form-control { min-height: 44px; }
.encounter-checkin .btn { padding-top: .55rem; padding-bottom: .55rem; }
.btn-caution {
  background: #fff7dd;
  border: 1px solid #e9d59b;
  color: #6b5721;
  border-radius: 14px;
  font-weight: 700;
}
.btn-caution:hover { background: #f9efcd; color: #5d4b1b; border-color: #ddc57f; }
.encounter-success, .encounter-pending {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-top: .75rem;
  padding: .65rem .75rem;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 650;
}
.encounter-success { background: #eaf8f4; color: #277965; }
.encounter-pending { background: #fff7dd; color: #6b5721; }

@media (max-width: 1199.98px) {
  .filter-grid-expanded { grid-template-columns: 1.2fr 1fr 1.2fr; }
  .filter-refresh { width: 100%; }
}

@media (max-width: 767.98px) {
  .filter-grid-expanded { grid-template-columns: 1fr 1fr; }
  .filter-category, .filter-age { grid-column: span 2; }
  .encounter-checkin { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
  .filter-grid-expanded { grid-template-columns: 1fr; }
  .filter-category, .filter-age { grid-column: auto; }
  .checkin-code-wrap { min-width: 96px; }
}
