/* bipdex.cl — misma identidad que la app: azul bip, ámbar, noche; Archivo para títulos y Figtree para texto. */
:root {
  --blue: #1D4F91;
  --blue-2: #3A6DB5;
  --amber: #F5A524;
  --night: #0E1A2E;
  --night-2: #16253D;
  --ground: #F3F5F9;
  --ink: #0E1A2E;
  --muted: #566478;
  --line: #D6DCE6;
  --white: #FFFFFF;
  --danger: #B42318;
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --wrap: 1080px;
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.55 var(--font-body);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--blue);
}

img,
svg {
  display: block;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--amber);
  color: var(--night);
  font-weight: 700;
}

.skip:focus {
  top: 12px;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.small {
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Botón ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 12px;
  background: var(--amber);
  color: var(--night);
  font: 700 17px/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.button:hover {
  background: #FFB43F;
}

.button:active {
  transform: translateY(1px);
}

.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* ---------- Encabezado ---------- */
.top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  padding-top: env(safe-area-inset-top, 0px);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font: 900 21px/1 var(--font-display);
  text-decoration: none;
}

.top-cta {
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  padding: 10px 14px;
  border: 1.5px solid rgb(255 255 255 / 0.35);
  border-radius: 10px;
}

.top-cta:hover {
  border-color: var(--amber);
}

/* ---------- Portada ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 108px 0 64px;
  background:
    radial-gradient(700px 420px at 85% 20%, rgb(58 109 181 / 0.45), transparent 70%),
    var(--night);
  color: var(--white);
}

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--amber);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(36px, 8.6vw, 60px);
  font-weight: 900;
  max-width: 13ch;
}

.lead {
  margin: 18px 0 28px;
  max-width: 34ch;
  color: #CBD5E1;
  font-size: 19px;
}

.hero-note {
  margin-top: 14px;
  color: #93A3BA;
  font-size: 14px;
}

/* Teléfono ilustrado: el escáner de la app reconociendo una tarjeta inventada. */
.phone {
  justify-self: center;
  width: min(280px, 74vw);
  aspect-ratio: 9 / 17;
  padding: 10px;
  border-radius: 38px;
  background: #050B16;
  box-shadow: 0 0 0 1.5px rgb(255 255 255 / 0.12), 0 30px 60px rgb(0 0 0 / 0.45);
}

.phone-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 26px 18px 18px;
  border-radius: 30px;
  background: linear-gradient(180deg, #1B2B44, #0F1A2C);
  overflow: hidden;
}

.phone-title {
  font-weight: 700;
  font-size: 15px;
}

.scan {
  position: relative;
  width: 100%;
  margin-top: 30%;
  aspect-ratio: 85.6 / 54;
}

.scan-card {
  position: absolute;
  inset: 6px;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(160deg, #FFD27A 0%, #F59E0B 55%, #E2701A 100%);
  transform: rotate(-2deg);
}

.card-band {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background: var(--blue);
}

.card-sun {
  position: absolute;
  top: 16%;
  left: 14%;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #FFF3D6;
}

.card-hill {
  position: absolute;
  bottom: 26%;
  border-radius: 50% 50% 0 0;
}

.card-hill.a {
  left: 30%;
  width: 70%;
  height: 34%;
  background: #C2410C;
}

.card-hill.b {
  left: -10%;
  width: 60%;
  height: 24%;
  background: #9A3412;
}

.card-chip {
  position: absolute;
  background: var(--blue);
  right: 7%;
  bottom: 7%;
  color: var(--white);
  font: 900 15px/1 var(--font-display);
}

.scan-sweep {
  position: absolute;
  inset: 6px;
  overflow: hidden;
  border-radius: 9px;
}

.scan-sweep::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -35%;
  width: 35%;
  background: linear-gradient(90deg, transparent, rgb(245 165 36 / 0.4) 55%, rgb(255 255 255 / 0.55) 70%, transparent);
  animation: sweep 1.6s ease-in-out infinite;
}

@keyframes sweep {
  to {
    transform: translateX(386%);
  }
}

.corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 0 solid var(--amber);
}

.tl { top: -3px; left: -3px; border-top-width: 5px; border-left-width: 5px; border-top-left-radius: 12px; }
.tr { top: -3px; right: -3px; border-top-width: 5px; border-right-width: 5px; border-top-right-radius: 12px; }
.bl { bottom: -3px; left: -3px; border-bottom-width: 5px; border-left-width: 5px; border-bottom-left-radius: 12px; }
.br { bottom: -3px; right: -3px; border-bottom-width: 5px; border-right-width: 5px; border-bottom-right-radius: 12px; }

.phone-status {
  margin-top: 18px;
  color: #CBD5E1;
  font-size: 13px;
}

.phone-shutter {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 58px;
  height: 58px;
  margin-left: -29px;
  border: 4px solid var(--white);
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px #15233A, inset 0 0 0 30px var(--white);
}

.phone-result {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 96px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  animation: pop 4.8s ease-in-out infinite;
}

.result-num {
  display: grid;
  place-items: center;
  min-width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--blue);
  color: var(--white);
  font: 900 15px/1 var(--font-display);
}

.result-text {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1.3;
}

.result-text span {
  color: var(--muted);
}

@keyframes pop {
  0%, 22% { opacity: 0; transform: translateY(14px); }
  30%, 92% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(0); }
}

/* ---------- Qué hace ---------- */
.features {
  padding: 72px 0;
  background: var(--white);
}

.features h2,
.signup h2 {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 900;
}

.feature-list {
  display: grid;
  gap: 18px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ground);
}

.feature-list svg {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  padding: 8px;
  border-radius: 10px;
  background: var(--blue);
  fill: none;
  stroke: var(--white);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-list h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.feature-list p {
  color: var(--muted);
}

/* ---------- Inscripción ---------- */
.signup {
  padding: 72px 0 84px;
  background: var(--ground);
}

/* Portada: el fondo del body es noche, así el encabezado transparente y el rebote del scroll quedan oscuros. */
body.home {
  background: var(--night);
}

.signup-grid {
  display: grid;
  gap: 28px;
  align-items: start;
}

.signup-copy p {
  margin-top: 14px;
  max-width: 40ch;
  color: var(--muted);
}

.form,
.done {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 12px 30px rgb(14 26 46 / 0.06);
}

.field {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.field > label,
legend {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-weight: 700;
}

input[type="email"],
input[type="text"] {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: 400 17px var(--font-body);
}

input[type="email"]:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgb(29 79 145 / 0.18);
}

input[aria-invalid="true"] {
  border-color: var(--danger);
}

.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.choice span {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.choice input:checked + span {
  border-color: var(--blue);
  background: rgb(29 79 145 / 0.08);
  color: var(--blue);
}

.choice input:focus-visible + span {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

.field > .check {
  display: flex;
  margin: 0;
  font-weight: 400;
}

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
}

.check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--blue);
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.error {
  margin-top: 8px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

.form .button {
  width: 100%;
}

.form-error {
  margin-top: 14px;
}

.done:focus {
  outline: none;
}

.done h3 {
  font-size: 24px;
}

.done > p {
  margin-top: 10px;
  color: var(--muted);
}

.apk {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.apk h4 {
  margin-bottom: 16px;
  font-size: 19px;
}

.apk .button {
  width: 100%;
}

.apk-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.steps {
  margin: 20px 0 16px;
  padding-left: 22px;
}

.steps li + li {
  margin-top: 6px;
}

.ios {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--ground);
  color: var(--muted);
}

/* ---------- Pie ---------- */
.foot {
  padding: 32px 0 calc(32px + env(safe-area-inset-bottom, 0px));
  background: var(--night);
  color: #CBD5E1;
}

.foot a {
  color: var(--white);
}

.foot-grid {
  display: grid;
  gap: 10px;
}

.foot .small {
  color: #93A3BA;
}

/* ---------- Aviso de privacidad ---------- */
.page {
  padding: 108px 0 72px;
}

.page .wrap {
  max-width: 720px;
}

.page h1 {
  font-size: clamp(30px, 7vw, 44px);
  font-weight: 900;
}

.page h2 {
  margin: 32px 0 10px;
  font-size: 21px;
}

.page p,
.page li {
  color: #2A3850;
}

.page p + p {
  margin-top: 10px;
}

.page ul {
  padding-left: 22px;
}

.page .updated {
  margin-top: 10px;
  color: var(--muted);
}

.top.light .brand {
  color: var(--ink);
}

.top.light .top-cta {
  color: var(--ink);
  border-color: var(--line);
}

/* ---------- Pantallas anchas ---------- */
@media (min-width: 820px) {
  .hero {
    padding: 132px 0 96px;
  }

  .hero-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .feature-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .signup-grid {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 56px;
  }

  .signup-grid > .done {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scan-sweep::after,
  .phone-result {
    animation: none;
  }
}
