/* NB Invicta — grande atualização de experiência, mobile e descoberta */
:root {
  --nb-safe-bottom: env(safe-area-inset-bottom, 0px);
  --nb-floating-size: 56px;
  --nb-floating-gap: 12px;
}

html {
  overflow-x: clip;
}

body {
  min-width: 320px;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #ffd43b !important;
  outline-offset: 3px !important;
}

.nb-home-hero-v2 {
  min-height: 570px;
  grid-template-columns: minmax(0, 1.16fr) minmax(340px, 0.84fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(2rem, 5vw, 4.2rem);
}

.nb-home-hero-copy-v2 h1 {
  font-size: clamp(3.2rem, 6.4vw, 6.5rem);
  line-height: 0.94;
}

.nb-hero-search-v32 {
  max-width: 680px;
  margin-top: 1.25rem;
}

.nb-hero-search-v32 > label {
  display: block;
  margin: 0 0 0.48rem 0.18rem;
  color: #e4efff;
  font-size: 0.8rem;
  font-weight: 850;
}

.nb-hero-search-v32 > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 0.42rem;
  background: rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(14px);
}

.nb-hero-search-v32 input {
  min-width: 0;
  min-height: 50px;
  border: 0;
  border-radius: 15px;
  padding: 0 1rem;
  color: #05224a;
  background: #fff;
  font: inherit;
}

.nb-hero-search-v32 input::placeholder {
  color: #607089;
}

.nb-hero-search-v32 button {
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 15px;
  padding: 0 1.1rem;
  color: #fff;
  background: #0d61d6;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
}

.nb-ecosystem-visual-v2 {
  min-height: 390px;
}

.nb-ecosystem-ring-v2 {
  width: min(360px, 100%);
}

.nb-ecosystem-core-v2 {
  width: 176px;
}

.nb-ecosystem-core-v2 img {
  width: 142px;
  height: 142px;
}

.nb-orbit-logo-v2 {
  width: 84px;
  height: 84px;
  border-radius: 26px;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.nb-orbit-logo-v2:hover,
.nb-orbit-logo-v2:focus-visible {
  z-index: 6;
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.3);
  animation-play-state: paused;
  transform: translateY(-5px) scale(1.06);
}

.nb-topic-paths-v32 {
  width: var(--nb-page);
  margin: 1rem auto 0;
  border: 1px solid var(--nb-line);
  border-radius: 28px;
  padding: 1rem;
  background: color-mix(in srgb, var(--nb-surface) 95%, #eaf3ff 5%);
  box-shadow: var(--nb-shadow-sm);
}

.nb-topic-paths-head-v32 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.15rem 0.25rem 0.85rem;
}

.nb-topic-paths-head-v32 span {
  color: var(--nb-ink);
  font-weight: 950;
}

.nb-topic-paths-head-v32 a {
  color: var(--nb-brand);
  font-size: 0.88rem;
  font-weight: 900;
  text-decoration: none;
}

.nb-topic-paths-grid-v32 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.nb-topic-paths-grid-v32 > a {
  min-height: 78px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 0.72rem;
  border: 1px solid var(--nb-line);
  border-radius: 18px;
  padding: 0.72rem;
  color: var(--nb-ink);
  background: var(--nb-surface);
  text-decoration: none;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.nb-topic-paths-grid-v32 > a:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 97, 214, 0.35);
  box-shadow: 0 12px 28px rgba(5, 34, 74, 0.1);
}

.nb-topic-paths-grid-v32 > a > span {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #0b3e84, #0d61d6);
  font-weight: 950;
}

.nb-topic-paths-grid-v32 strong,
.nb-topic-paths-grid-v32 small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-topic-paths-grid-v32 strong {
  align-self: end;
  font-size: 0.94rem;
}

.nb-topic-paths-grid-v32 small {
  align-self: start;
  color: var(--nb-muted);
  font-size: 0.75rem;
}

/* Controlos flutuantes compactos e coordenados */
.favorite-floating {
  right: 20px !important;
  bottom: calc(88px + var(--nb-safe-bottom)) !important;
  width: 52px !important;
  height: 52px !important;
  min-height: 52px !important;
  justify-content: center !important;
  padding: 0 !important;
  z-index: 970 !important;
}

.favorite-floating-label {
  display: none !important;
}

.favorite-floating-icon {
  font-size: 1.55rem !important;
}

.favorite-floating.is-saved {
  border-color: #e5ad00 !important;
  color: #533700 !important;
  background: #ffd43b !important;
  box-shadow: 0 12px 30px rgba(229, 173, 0, 0.3) !important;
}

.favorite-toast {
  right: 16px !important;
  bottom: calc(150px + var(--nb-safe-bottom)) !important;
}

.nb-titor-v2 {
  right: 16px !important;
  bottom: calc(16px + var(--nb-safe-bottom)) !important;
}

.nb-titor-panel-v2 {
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 104px - var(--nb-safe-bottom));
}

.nb-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

html[data-nb-theme="dark"] .nb-topic-paths-v32,
html[data-nb-theme="dark"] .nb-topic-paths-grid-v32 > a {
  border-color: #2a405a;
  background: #102339;
}

html[data-nb-theme="dark"] .nb-topic-paths-grid-v32 > a:hover {
  border-color: #5f9cec;
}

@media (max-width: 1400px) {
  .nb-titor-trigger-v2 {
    width: 58px !important;
    padding: 0.36rem !important;
  }

  .nb-titor-trigger-v2 > span {
    display: none !important;
  }
}

@media (max-width: 1050px) {
  .nb-home-hero-v2 {
    grid-template-columns: 1fr;
  }

  .nb-ecosystem-visual-v2 {
    min-height: 350px;
  }

  .nb-topic-paths-grid-v32 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: calc(76px + var(--nb-safe-bottom));
  }

  .nb-home-hero-v2 {
    padding: 1.4rem !important;
  }

  .nb-home-hero-copy-v2 h1 {
    margin-top: 0.85rem;
    font-size: clamp(2.65rem, 13vw, 4rem);
  }

  .nb-home-hero-copy-v2 > p {
    line-height: 1.58;
  }

  .nb-hero-search-v32 > div {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .nb-hero-search-v32 button {
    width: 100%;
  }

  .nb-ecosystem-visual-v2 {
    min-height: 280px !important;
  }

  .nb-ecosystem-ring-v2 {
    width: 244px !important;
  }

  .nb-ecosystem-core-v2 {
    width: 118px !important;
    border-radius: 27px !important;
  }

  .nb-ecosystem-core-v2 img {
    width: 94px !important;
    height: 94px !important;
  }

  .nb-orbit-logo-v2 {
    width: 62px !important;
    height: 62px !important;
    border-radius: 19px !important;
  }

  .nb-topic-paths-v32 {
    width: min(100% - 20px, 1180px);
    border-radius: 22px;
    padding: 0.75rem;
  }

  .nb-topic-paths-head-v32 {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .nb-topic-paths-grid-v32 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .nb-topic-paths-grid-v32 > a {
    min-height: 76px;
    grid-template-columns: 38px minmax(0, 1fr);
    column-gap: 0.55rem;
    border-radius: 16px;
    padding: 0.58rem;
  }

  .nb-topic-paths-grid-v32 > a > span {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .nb-topic-paths-grid-v32 small {
    font-size: 0.69rem;
  }

  .favorite-floating {
    right: 12px !important;
    bottom: calc(82px + var(--nb-safe-bottom)) !important;
    width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
  }

  .nb-titor-v2 {
    right: 10px !important;
    bottom: calc(10px + var(--nb-safe-bottom)) !important;
  }

  .nb-titor-panel-v2 {
    right: 8px !important;
    bottom: calc(78px + var(--nb-safe-bottom)) !important;
    width: calc(100vw - 16px) !important;
    height: min(720px, calc(100dvh - 92px - var(--nb-safe-bottom))) !important;
  }
}

@media (max-width: 390px) {
  .nb-topic-paths-grid-v32 {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nb-orbit-logo-v2 {
    animation: none !important;
  }
}

@media print {
  .favorite-floating,
  .favorite-toast,
  .nb-topic-paths-v32,
  .nb-titor-v2 {
    display: none !important;
  }
}
