/* ─── Home / Index — Inteligency.AI ─────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --home-bg: #000000;
  --accent: #107646;
  --accent-bright: #25A574;
  --card-bg: #060A0B;
  --card-border: rgba(255, 255, 255, 0.12);
  --header-divider: rgba(255, 255, 255, 0.2);
  --white: #ffffff;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --header-pad-x: clamp(14px, 4vw, 22px);
  --dock-height: clamp(76px, 18vw, 88px);
  --dock-radius: 22px;
  /* Área ocupada pela barra do header (~conteúdo + paddings verticais, sem notch) */
  --app-header-inner: 74px;
}

@media (max-width: 620px) {
  :root {
    --app-header-inner: 64px;
  }
}

html, body.page-home {
  min-height: 100%;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  background: var(--home-bg);
  color: var(--white);
}

body.page-home {
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--app-header-inner));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Header ────────────────────────────────────────────────── */
.app-header-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  width: 100%;
  padding-top: env(safe-area-inset-top, 0px);
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--header-divider);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.app-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px 14px;
  padding: 14px var(--header-pad-x) 18px;
  max-width: 1200px;
  margin: 0 auto;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  flex-wrap: nowrap;
  justify-self: start;
  min-width: 0;
}

.app-header__logo-img {
  width: clamp(28px, 7vw, 36px);
  height: auto;
  max-height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  filter: brightness(1.05);
}

.app-header__logo-text {
  font-size: clamp(13px, 3.2vw, 16px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--white);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quantix-pill {
  font-size: clamp(10px, 2.4vw, 11px);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #107646;
  background: transparent;
  box-shadow: inset 0 1px 0 rgba(16, 118, 70, 0.12);
  flex-shrink: 0;
}

.app-header__country {
  justify-self: center;
}

.select-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 72px;
  width: auto;
  max-width: 100px;
}

.country-picker__face {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding: 0 28px 0 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.country-picker__flag {
  display: block;
  width: 24px;
  height: auto;
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.select-shell:focus-within .country-picker__face {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(37, 165, 116, 0.2);
}

.country-picker:focus-within .country-picker__face,
.country-picker__face:hover {
  border-color: rgba(37, 165, 116, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

.select-shell__chev {
  position: absolute;
  right: 12px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
  z-index: 1;
}

.app-header__action {
  justify-self: end;
}

.btn-conectar {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 18px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--white);
  background: #25A574;
  border: none;
  border-radius: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.2s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(37, 165, 116, 0.26);
  text-decoration: none;
}

.btn-conectar:hover {
  filter: brightness(1.08);
}

.btn-conectar:active {
  transform: scale(0.98);
}

.btn-conectar--connected {
  cursor: default;
  background: #1f6f50;
  box-shadow: 0 4px 12px rgba(31, 111, 80, 0.35);
  pointer-events: auto;
}

.btn-conectar--connected:hover {
  filter: brightness(1.02);
}

@media (max-width: 620px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px 8px;
    padding: 10px clamp(8px, 2.5vw, 14px) 14px;
    max-width: 100%;
  }

  .app-header__brand {
    justify-self: start;
    justify-content: flex-start;
    gap: 4px 6px;
  }

  .app-header__logo-img {
    width: clamp(22px, 5.5vw, 28px);
    max-height: 28px;
  }

  .app-header__logo-text {
    font-size: clamp(9px, 2.65vw, 12px);
    letter-spacing: 0.05em;
  }

  .quantix-pill {
    padding: 4px 7px;
    font-size: clamp(8px, 2vw, 10px);
    letter-spacing: 0.1em;
  }

  .app-header__country {
    justify-self: center;
    width: auto;
    max-width: none;
  }

  .select-shell {
    min-width: 56px;
    max-width: 76px;
    margin: 0;
  }

  .country-picker__face {
    min-height: 32px;
    padding: 0 22px 0 8px;
    border-radius: 9px;
  }

  .country-picker__flag {
    width: 20px;
  }

  .select-shell__chev {
    right: 8px;
    font-size: 9px;
  }

  .app-header__action {
    justify-self: end;
    width: auto;
    max-width: none;
  }

  .btn-conectar {
    width: auto;
    height: 32px;
    padding: 0 12px;
    font-size: clamp(11px, 3vw, 12px);
    border-radius: 12px;
  }
}

/* ─── Main ─────────────────────────────────────────────────── */
.home-main {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(16px, 5vw, 40px) var(--header-pad-x)
    calc(var(--dock-height) + 32px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.welcome-line {
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1.25;
}

.welcome-name {
  margin-top: 10px;
  font-size: clamp(26px, 7vw, 36px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.home-logo-wrap {
  margin-top: clamp(20px, 11vw, 24px);
  margin-bottom: clamp(40px, 7vw, 40px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-loop-video {
  max-width: min(405px, 92vw);
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  filter: brightness(1.05);
  object-fit: contain;
}

/* ─── Stats cards ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 2.5vw, 14px);
  row-gap: clamp(10px, 3vw, 16px);
  width: 100%;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: clamp(14px, 4vw, 20px) 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 88px;
}

.stat-card__value {
  font-size: clamp(17px, 4.5vw, 22px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.stat-card__label {
  font-size: clamp(10px, 2.6vw, 12px);
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.02em;
  text-align: center;
}

@media (max-width: 380px) {
  .stat-card {
    padding: clamp(10px, 3vw, 14px) 4px;
    min-height: 76px;
  }

  .stat-card__value {
    font-size: clamp(14px, 4vw, 18px);
  }

  .stat-card__label {
    font-size: clamp(9px, 2.4vw, 11px);
  }
}

/* ─── Footer dock ───────────────────────────────────────────── */
.dock-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 4px;
  padding: 12px 8px 14px;
  background: #000000;
  border-radius: var(--dock-radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 -8px 32px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  z-index: 100;
}

.dock-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 12px;
  transition: color 0.2s, background 0.2s;
  min-width: 0;
}

.dock-nav__item:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.04);
}

.dock-nav__item--active {
  color: var(--accent-bright);
}

.dock-nav__icon {
  font-size: 18px;
  line-height: 1;
}

@media (min-width: 480px) {
  .dock-nav__icon {
    font-size: 20px;
  }

  .dock-nav__item span {
    font-size: 11px;
  }
}
