/* BetChat APK download — premium forest / neon chip aesthetic */

:root {
  --bg-deep: #061410;
  --bg-mid: #0a1c17;
  --forest: #075e54;
  --teal: #128c7e;
  --accent: #25d366;
  --accent-soft: #3ae07a;
  --lime: #b6ff3d;
  --text: #e8f5ef;
  --text-muted: #8fa89c;
  --line: rgba(37, 211, 102, 0.18);
  --cta-ink: #04140e;
  --radius: 12px;
  --font-display: "Syne", sans-serif;
  --font-body: "Outfit", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 40rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/*
 * Author `display` on .btn (inline-flex) overrides the UA [hidden] rule.
 * Without !important, Cancelar/Instalar ignore the hidden attribute.
 */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent-soft);
}

a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

/* —— Atmosphere (full-bleed plane) —— */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, #0f3a30 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(7, 94, 84, 0.45) 0%, transparent 50%),
    radial-gradient(80% 60% at 0% 80%, rgba(18, 140, 126, 0.28) 0%, transparent 45%),
    linear-gradient(165deg, var(--bg-mid) 0%, var(--bg-deep) 48%, #030a08 100%);
}

.atmosphere__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
  animation: drift 18s var(--ease-out) infinite alternate;
}

.atmosphere__glow--a {
  width: min(55vw, 420px);
  height: min(55vw, 420px);
  top: 6%;
  left: calc(50% - min(27.5vw, 210px));
  background: rgba(37, 211, 102, 0.16);
}

.atmosphere__glow--b {
  width: min(70vw, 520px);
  height: min(70vw, 520px);
  bottom: -12%;
  right: -8%;
  background: rgba(7, 94, 84, 0.5);
  animation-duration: 24s;
  animation-delay: -6s;
}

.atmosphere__mesh {
  position: absolute;
  inset: -10%;
  opacity: 0.07;
  background-image:
    linear-gradient(rgba(182, 255, 61, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(182, 255, 61, 0.55) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 20%, transparent 75%);
  animation: mesh-drift 28s linear infinite;
}

@keyframes drift {
  from {
    transform: translate3d(-4%, 0, 0) scale(1);
  }
  to {
    transform: translate3d(4%, 3%, 0) scale(1.08);
  }
}

@keyframes mesh-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-24px, -24px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere__glow,
  .atmosphere__mesh,
  .hero__logo,
  .hero__brand,
  .hero__headline,
  .hero__support,
  .cta-stack,
  .tutorial__inner {
    animation: none !important;
  }
}

/* —— Layout —— */

main {
  position: relative;
  z-index: 1;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(1.15rem, 3.5vw, 1.85rem) 1.35rem 1.1rem;
  text-align: center;
}

.hero__visual {
  margin-bottom: clamp(0.65rem, 2vw, 1rem);
}

.hero__logo {
  width: clamp(120px, 28vw, 176px);
  height: auto;
  border-radius: 50%;
  animation: enter-logo 1s var(--ease-out) both;
}

.hero__brand {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 10vw, 4.5rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: var(--text);
  text-shadow: 0 0 40px rgba(37, 211, 102, 0.28);
  animation: enter-up 0.9s var(--ease-out) 0.12s both;
}

.hero__headline {
  margin: 0 auto 0.5rem;
  max-width: 22ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 3.2vw, 1.45rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: rgba(232, 245, 239, 0.92);
  animation: enter-up 0.9s var(--ease-out) 0.22s both;
}

.hero__support {
  margin: 0 auto 1rem;
  max-width: 34ch;
  font-size: clamp(0.95rem, 2.3vw, 1.05rem);
  font-weight: 400;
  color: var(--text-muted);
  animation: enter-up 0.9s var(--ease-out) 0.32s both;
}

.cta-stack {
  width: min(100%, 24rem);
  animation: enter-up 0.9s var(--ease-out) 0.42s both;
}

/* —— Download card —— */

.installer {
  width: 100%;
}

.installer__card {
  padding: 1.15rem 1.1rem 1.2rem;
  border: 1px solid rgba(37, 211, 102, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(165deg, rgba(37, 211, 102, 0.07) 0%, rgba(7, 94, 84, 0.16) 100%);
  text-align: left;
  box-shadow: 0 0 0 1px rgba(37, 211, 102, 0.08);
}

.installer__card-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  align-items: start;
  margin-bottom: 0.95rem;
}

.installer__card-head--solo {
  grid-template-columns: 1fr;
}

.installer__title {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.installer__hint {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.installer__hint strong {
  color: rgba(232, 245, 239, 0.92);
  font-weight: 600;
}

.installer__actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.btn:disabled,
.btn[aria-busy="true"] {
  opacity: 0.72;
  cursor: progress;
  transform: none;
  box-shadow: none;
}

.btn:disabled:hover,
.btn[aria-busy="true"]:hover {
  transform: none;
  box-shadow: none;
  background: var(--accent);
}

/* —— APK download progress (no install wizard) —— */

.download-progress {
  margin-top: 0.95rem;
  padding: 0.85rem 0.9rem 0.95rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid rgba(37, 211, 102, 0.22);
  background: rgba(6, 20, 16, 0.45);
}

.download-progress[hidden] {
  display: none !important;
}

.download-progress__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.download-progress__status {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(232, 245, 239, 0.95);
}

.download-progress__pct {
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-soft);
}

.download-progress__track {
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(37, 211, 102, 0.14);
}

.download-progress__bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    var(--teal) 0%,
    var(--accent) 55%,
    var(--lime) 100%
  );
  background-size: 160% 100%;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.28);
  transition: width 0.12s linear;
  animation: download-sheen 2.4s linear infinite;
}

@keyframes download-sheen {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -60% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .download-progress__bar,
  .download-progress__bar--indeterminate {
    animation: none !important;
  }
}

.download-progress__bar--indeterminate {
  width: 38% !important;
  animation: download-indeterminate 1.1s ease-in-out infinite;
}

.download-progress__hint {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.download-progress[data-state="done"] .download-progress__status {
  color: var(--accent-soft);
}

.download-progress[data-state="error"] .download-progress__status {
  color: #ff8f8f;
}

.download-progress[data-state="error"] .download-progress__track {
  background: rgba(255, 120, 120, 0.12);
}

@keyframes download-indeterminate {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(280%);
  }
}

.install-steps {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.install-steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

@keyframes enter-logo {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes enter-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Buttons (no pills) —— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    transform 0.18s var(--ease-out),
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.btn--primary {
  background: var(--accent);
  color: var(--cta-ink);
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
}

.btn--primary:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.22);
}

.btn--primary:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: none;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
  font-weight: 600;
}

.btn--ghost:hover {
  border-color: rgba(37, 211, 102, 0.45);
  background: rgba(37, 211, 102, 0.06);
  transform: translateY(-1px);
}

.btn--ghost:active {
  transform: translateY(1px);
}

/* —— Install tutorial —— */

.tutorial {
  position: relative;
  z-index: 1;
  padding: 0.35rem 1.35rem clamp(2.25rem, 6vw, 3.5rem);
}

.tutorial__inner {
  width: min(100%, 34rem);
  margin: 0 auto;
  text-align: center;
  animation: enter-up 0.9s var(--ease-out) both;
}

.tutorial__title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: rgba(232, 245, 239, 0.96);
}

.tutorial__support {
  margin: 0 auto 1rem;
  max-width: 36ch;
  font-size: clamp(0.95rem, 2.3vw, 1.05rem);
  color: var(--text-muted);
}

.tutorial__stage {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid rgba(37, 211, 102, 0.28);
  background:
    linear-gradient(165deg, rgba(37, 211, 102, 0.06) 0%, rgba(7, 94, 84, 0.14) 100%),
    #04120e;
  box-shadow:
    0 0 0 1px rgba(37, 211, 102, 0.06),
    0 18px 48px rgba(0, 0, 0, 0.35);
  aspect-ratio: 384 / 864;
  max-height: min(72dvh, 680px);
  margin-inline: auto;
  width: min(100%, 22.5rem);
}

.tutorial__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #030a08;
}

.tutorial__video:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: -2px;
}

@media (min-width: 720px) {
  .tutorial__stage {
    width: min(100%, 24rem);
  }
}

/* —— Footer —— */

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.35rem 2rem;
  border-top: 1px solid rgba(37, 211, 102, 0.1);
}

.site-footer__nav {
  display: flex;
  gap: 1.25rem;
}

.site-footer__nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer__nav a:hover {
  color: var(--accent-soft);
}

.site-footer__copy {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(143, 168, 156, 0.7);
}

@media (min-width: 720px) {
  .installer .btn {
    width: 100%;
  }
}
