/* AmaPay - pagina de inicio (estilo oficial de la app) */

/* ---------- Motivo de marca: la "gota" de los petalos del logo ---------- */

.drop {
  position: absolute;
  border-radius: 50% 50% 50% 14% / 50% 50% 50% 14%;
  pointer-events: none;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: calc(var(--header-h) + clamp(40px, 6vw, 84px)) 0 clamp(88px, 10vw, 128px);
  overflow: hidden;
  isolation: isolate;
  background: var(--primary);
}
/* Fondo WebGL: ondas en los azules de la marca. Sin WebGL queda el azul plano. */
.hero-gl {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.hero-gl.is-ready {
  opacity: 1;
}
.hero-cut {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: clamp(28px, 4vw, 64px);
  fill: var(--surface);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}
.hero-copy {
  display: grid;
  gap: 24px;
  justify-items: start;
}
.hero-copy .h-display {
  color: #fff;
  max-width: 15ch;
}
.hero-copy .h-display em {
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--mint);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.14em;
  text-decoration-skip-ink: none;
}
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.hero-points li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero-points li::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--mint)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%23205031' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>")
    center / 16px no-repeat;
}

/* Composicion: gotas recortadas + telefono + tarjeta flotante */
.hero-visual {
  position: relative;
  justify-self: center;
  width: min(100%, 360px);
}
.drop-a {
  width: 118%;
  aspect-ratio: 1;
  left: -12%;
  top: 6%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.drop-b {
  width: 34%;
  aspect-ratio: 1;
  right: -14%;
  bottom: 4%;
  background: var(--mint);
  transform: rotate(180deg);
  opacity: 0.9;
}

.device {
  position: relative;
  border-radius: 44px;
  padding: 10px;
  background: #121212;
  box-shadow: 0 40px 80px -36px rgba(10, 25, 70, 0.75);
}
.device-screen {
  border-radius: 35px;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  min-height: 600px;
  display: flex;
  flex-direction: column;
}
/* Banda azul de la app */
.app-bar {
  background: var(--brand);
  padding: 44px 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.app-bar::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 92px;
  height: 24px;
  margin-left: -46px;
  border-radius: 20px;
  background: #121212;
}
.app-logo {
  width: 96px;
  height: auto;
}
.app-chip {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  padding: 4px 7px;
}
.app-body {
  padding: 18px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.app-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.amount-field {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-areas: "cur label" "cur amount";
  align-items: center;
  column-gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.amount-field.is-receive {
  border-color: var(--brand);
  background: var(--soft);
}
.amount-field .currency {
  grid-area: cur;
  font-size: 13px;
  font-weight: 700;
  border-right: 1px solid var(--line);
  height: 100%;
  display: flex;
  align-items: center;
}
.amount-field .field-label {
  grid-area: label;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}
.amount-field .amount {
  grid-area: amount;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}
.exchange-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: 4px solid var(--bg);
  display: grid;
  place-items: center;
  font-size: 11px;
  margin: -16px auto;
  position: relative;
  z-index: 1;
}
.app-rows {
  display: grid;
  gap: 7px;
  font-size: 12px;
  margin-top: 6px;
}
.app-rows div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-3);
}
.app-rows dd {
  color: var(--text);
  font-weight: 500;
}
.app-rows .total {
  border-top: 1px solid var(--line);
  padding-top: 9px;
  margin-top: 2px;
  color: var(--text);
  font-weight: 700;
}
.app-rows .total dd {
  font-size: 14px;
  font-weight: 700;
}
.app-cta {
  margin-top: auto;
  height: 50px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.float-card {
  position: absolute;
  right: -52px;
  top: -26px;
  width: 224px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  box-shadow: var(--shadow-float);
  display: grid;
  gap: 2px;
  font-size: 13px;
}
.float-card .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--ok);
}
.float-card .status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.float-card .ref {
  font-size: 12px;
  color: var(--text-3);
}
.illustrative {
  margin-top: 28px;
  font-size: 12px;
  color: var(--on-dark-2);
  text-align: right;
}

/* ---------- Animacion de carga del hero (una sola coreografia) ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}
@keyframes rise-phone {
  from {
    opacity: 0;
    transform: translateY(48px) rotate(-2deg);
  }
}
@keyframes pop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes drop-in {
  from {
    opacity: 0;
    transform: scale(0.8) rotate(-12deg);
  }
}
.js .load-in {
  animation: rise 0.8s var(--ease-out) both;
  animation-delay: calc(var(--d, 0) * 90ms + 80ms);
}
.js .load-up {
  animation: rise-phone 1s var(--ease-out) 0.25s both;
}
.js .load-pop {
  animation: pop 0.6s var(--ease-out) 1.25s both;
}
.js .hero-visual .drop-a {
  animation: drop-in 1.2s var(--ease-out) 0.1s both;
}
.js .hero-visual .drop-b {
  animation: drop-in 1.2s var(--ease-out) 0.5s both;
}

/* ---------- Franja de hechos ---------- */

.facts {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.facts-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
}
.facts-list li {
  padding: 28px 24px 34px;
  border-left: 1px solid var(--line);
  display: grid;
  gap: 4px;
  align-content: start;
}
.facts-list li:first-child {
  border-left: 0;
  padding-left: 0;
}
.facts-list i {
  color: var(--brand);
  font-size: 18px;
  margin-bottom: 8px;
}
.facts-list strong {
  font-size: 16px;
  font-weight: 700;
}
.facts-list span {
  font-size: 14px;
  color: var(--text-3);
}

/* ---------- Como funciona ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  list-style: none;
  position: relative;
}
/* Linea que une los pasos: se dibuja al entrar en pantalla */
.steps::before {
  content: "";
  position: absolute;
  top: 46px;
  left: 44px;
  right: 44px;
  height: 2px;
  background: var(--soft-2);
  transform-origin: left;
}
.js .steps::before {
  transform: scaleX(0);
  transition: transform 1.4s var(--ease-out) 0.2s;
}
.js .steps.is-drawn::before {
  transform: scaleX(1);
}
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 26px 28px;
  display: grid;
  align-content: start;
  gap: 12px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.step:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
}
.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: 4px solid var(--soft);
  box-sizing: content-box;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}
.step p {
  color: var(--text-2);
  font-size: 16px;
}
.step-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-strong);
  background: var(--soft);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

/* ---------- La app en movimiento (video) ---------- */

.showcase {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.showcase-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: center;
}
.showcase-media {
  position: relative;
  justify-self: center;
  width: min(100%, 320px);
}
.drop-c {
  width: 150%;
  aspect-ratio: 1;
  left: -25%;
  top: 8%;
  background: var(--soft);
  transform: rotate(90deg);
}
.device-video {
  padding: 9px;
  border-radius: 42px;
}
.device-video-el {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 600 / 1298;
  border-radius: 34px;
  background: var(--bg);
  object-fit: cover;
}
.video-toggle {
  position: absolute;
  right: -8px;
  bottom: 40px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-card);
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.video-toggle:hover {
  background: var(--soft);
}
.video-toggle:active {
  transform: scale(0.96);
}
.showcase-copy {
  display: grid;
  gap: 20px;
}
.showcase-list {
  list-style: none;
  counter-reset: sc;
  display: grid;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.showcase-list li {
  counter-increment: sc;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 2px 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.showcase-list li::before {
  content: counter(sc);
  grid-row: span 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--primary-strong);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.showcase-list strong {
  font-size: 17px;
}
.showcase-list span {
  color: var(--text-3);
  font-size: 15px;
}
.showcase-note {
  font-size: 13px;
  color: var(--text-3);
}

/* Recorte que se abre al entrar en pantalla */
.js .reveal-clip {
  clip-path: inset(18% 12% 18% 12% round 40px);
  opacity: 0;
  transition: clip-path 1.1s var(--ease-out), opacity 0.6s var(--ease-out);
}
.js .reveal-clip.is-visible {
  /* Abierto mas alla del borde para no recortar sombras ni las gotas decorativas */
  clip-path: inset(-40% -60% -40% -60% round 0px);
  opacity: 1;
}

/* ---------- Destinos ---------- */

.corridors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}
.corridor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  gap: 18px;
  transition: border-color 0.25s var(--ease);
}
.corridor:hover {
  border-color: var(--brand);
}
.corridor-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.corridor-flag {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50% 50% 50% 14% / 50% 50% 50% 14%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: grid;
  place-items: center;
}
.corridor-code {
  font-size: 12px;
  color: var(--text-3);
}
.corridor ul {
  list-style: none;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 15px;
  color: var(--text-2);
}
.corridor li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.corridor li span:last-child {
  color: var(--text-3);
  font-size: 13px;
  white-space: nowrap;
}

/* ---------- Servicios ---------- */

.services {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.services-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.services-intro {
  position: sticky;
  top: calc(var(--header-h) + 40px);
  display: grid;
  gap: 16px;
}
.service-list {
  list-style: none;
  border-top: 1px solid var(--line);
}
.service {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 4px 18px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.service-icon {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 17px;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.service:hover .service-icon {
  background: var(--primary);
  color: #fff;
}
.service p {
  color: var(--text-2);
  font-size: 16px;
  max-width: 52ch;
}

/* ---------- Seguridad ---------- */

.security {
  background: var(--soft);
}
.security-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.security-intro {
  display: grid;
  gap: 18px;
}
.security-mark {
  width: 72px;
  height: 72px;
  border-radius: 50% 50% 50% 14% / 50% 50% 50% 14%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 30px;
  margin-bottom: 6px;
}
.security-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.security-item {
  background: var(--surface);
  border: 1px solid var(--soft-2);
  border-radius: var(--radius-lg);
  padding: 24px 22px 26px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.security-item i {
  color: var(--primary);
  font-size: 20px;
  margin-bottom: 4px;
}
.security-item h3 {
  font-size: 17px;
  font-weight: 700;
}
.security-item p {
  color: var(--text-2);
  font-size: 15px;
}

/* ---------- Nosotros + descarga ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.about-copy {
  display: grid;
  gap: 18px;
}
.about-copy p {
  color: var(--text-2);
  max-width: 56ch;
}
.download-card {
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 44px);
  display: grid;
  gap: 20px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.drop-d {
  z-index: -1;
  width: 300px;
  aspect-ratio: 1;
  right: -90px;
  bottom: -120px;
  background: rgba(255, 255, 255, 0.12);
  transform: rotate(180deg);
}
.download-card h2 {
  color: #fff;
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.download-card p {
  color: var(--on-dark-2);
  max-width: 40ch;
}

/* ---------- Responsivo ---------- */

@media (max-width: 1080px) {
  .float-card {
    right: -20px;
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .services-grid,
  .security-grid,
  .about-grid,
  .showcase-grid {
    grid-template-columns: 1fr;
  }
  .services-intro {
    position: static;
  }
  .steps,
  .corridors {
    grid-template-columns: 1fr;
  }
  .steps::before {
    display: none;
  }
  .facts-list {
    grid-template-columns: 1fr 1fr;
  }
  .facts-list li:nth-child(3) {
    border-left: 0;
    padding-left: 0;
  }
  .facts-list li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .hero-visual {
    margin-top: 12px;
  }
  .illustrative {
    text-align: center;
  }
  .showcase-media {
    order: 2;
  }
}

@media (max-width: 560px) {
  .security-list,
  .facts-list {
    grid-template-columns: 1fr;
  }
  .facts-list li {
    border-left: 0;
    padding: 22px 0;
  }
  .facts-list li + li {
    border-top: 1px solid var(--line);
  }
  .hero-visual {
    width: min(100%, 320px);
  }
  /* En celular la tarjeta va debajo del telefono, sin encimarse */
  .float-card {
    position: relative;
    right: auto;
    top: auto;
    margin: -32px auto 0;
  }
  .drop-b {
    right: -6%;
  }
  .device-screen {
    min-height: 540px;
  }
  .store-btn {
    flex: 1 1 0;
    padding: 0 12px;
  }
  .store-btn strong {
    font-size: 16px;
  }
  .video-toggle {
    right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .load-in,
  .js .load-up,
  .js .load-pop,
  .js .hero-visual .drop {
    animation: none;
  }
  .js .reveal-clip {
    clip-path: none;
    opacity: 1;
  }
  .js .steps::before {
    transform: none;
  }
  .step:hover {
    transform: none;
  }
}
