:root {
  --celeste: #10afd9;
  --verde: #a3d512;
  --gris: #444444;
  --negro: #202020;
  --blanco: #ffffff;

  /* Firma de marca: celeste -> verde (como el isotipo) */
  --grad: linear-gradient(118deg, var(--celeste) 0%, #39c39a 52%, var(--verde) 100%);

  /* Texto sobre el fondo gris */
  --on-dark: #ffffff;
  --on-dark-soft: rgba(255, 255, 255, 0.78);
  --on-dark-faint: rgba(255, 255, 255, 0.55);
  --line-dark: rgba(255, 255, 255, 0.12);

  --page-a: #4a4a4a;
  --page-b: #3a3a3a;

  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--on-dark);
  background: var(--gris);
  background: radial-gradient(130% 120% at 15% 0%, var(--page-a) 0%, var(--page-b) 70%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }

.bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.34;
  will-change: transform;
}
.bg__glow--celeste {
  width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  background: radial-gradient(circle at 35% 35%, var(--celeste), transparent 68%);
  top: -14vw; left: -10vw;
  animation: drift1 24s ease-in-out infinite;
}
.bg__glow--verde {
  width: 42vw; height: 42vw; max-width: 560px; max-height: 560px;
  background: radial-gradient(circle at 65% 65%, var(--verde), transparent 68%);
  bottom: -16vw; right: -12vw;
  animation: drift2 28s ease-in-out infinite;
}
.bg__dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1.1px, transparent 1.1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 75% 65% at 48% 42%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 48% 42%, #000 35%, transparent 100%);
}

@keyframes drift1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(40px, 44px) scale(1.08); }
}
@keyframes drift2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-46px, -34px) scale(1.06); }
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem clamp(1.25rem, 5vw, 4rem);
  flex-wrap: wrap;
}

.logo { height: clamp(46px, 5.6vw, 64px); width: auto; display: block; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--on-dark-soft);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-dark);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.status__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--verde);
  box-shadow: 0 0 0 0 rgba(163, 213, 18, 0.65);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(163, 213, 18, 0.6); }
  70% { box-shadow: 0 0 0 9px rgba(163, 213, 18, 0); }
  100% { box-shadow: 0 0 0 0 rgba(163, 213, 18, 0); }
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.25rem, 5vw, 4rem) clamp(2.5rem, 5vw, 4rem);
}

.intro { max-width: 40rem; min-width: 0; animation: rise 0.7s ease both; }

.headline {
  font-size: clamp(2.15rem, 4.7vw, 3.5rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.028em;
  color: var(--on-dark);
  margin-bottom: 1.15rem;
  text-wrap: balance;
}

.subhead {
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  line-height: 1.6;
  color: var(--on-dark-soft);
  max-width: 33rem;
  margin-bottom: 1.9rem;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 30rem;
  margin-bottom: 1.9rem;
}

.chat__bubble {
  --enter-delay: 0s;
  position: relative;
  max-width: 85%;
  padding: 0.8rem 1.05rem;
  font-size: 0.97rem;
  line-height: 1.45;
  border-radius: 18px;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  animation: bubbleIn 0.55s cubic-bezier(.2,.8,.3,1) forwards;
  animation-delay: var(--enter-delay);
}

.chat__bubble--in {
  align-self: flex-start;
  background: var(--blanco);
  color: var(--negro);
  border-bottom-left-radius: 5px;
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.55);
  --enter-delay: 0.25s;
}

.chat__bubble--out {
  align-self: flex-end;
  background: var(--grad);
  color: var(--blanco);
  border-bottom-right-radius: 5px;
  box-shadow: 0 16px 34px -18px rgba(16, 175, 217, 0.7);
  --enter-delay: 2.9s;
}
.chat__bubble--out.chat__bubble--short {
  font-weight: 600;
  --enter-delay: 3.6s;
}

.chat__typing {
  align-self: flex-end;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 0.85rem 1.05rem;
  border-radius: 18px;
  border-bottom-right-radius: 5px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  opacity: 0;
  max-height: 0;
  margin-bottom: -0.55rem;
  animation: typingCycle 2.5s ease forwards;
  animation-delay: 0.95s;
}
.chat__typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  animation: typingDot 1.3s ease-in-out infinite;
}
.chat__typing span:nth-child(2) { animation-delay: 0.18s; }
.chat__typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes bubbleIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes typingCycle {
  0%   { opacity: 0; max-height: 0;    margin-bottom: -0.55rem; transform: translateY(8px); }
  14%  { opacity: 1; max-height: 48px; margin-bottom: 0;        transform: translateY(0); }
  74%  { opacity: 1; max-height: 48px; margin-bottom: 0;        transform: translateY(0); }
  100% { opacity: 0; max-height: 0;    margin-bottom: -0.55rem; transform: translateY(0); }
}
@keyframes typingDot {
  0%,60%,100% { transform: translateY(0); opacity: 0.55; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.caps {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  max-width: 33rem;
  font-size: 0.92rem;
  color: var(--on-dark-soft);
  line-height: 1.5;
}
.caps li { padding-left: 1.1rem; position: relative; }
.caps li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.58em;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--grad);
}
.caps b { color: var(--on-dark); font-weight: 600; }

.panel {
  position: relative;
  background: var(--blanco);
  color: var(--negro);
  border-radius: 22px;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  min-width: 0;
  box-shadow:
    0 44px 90px -45px rgba(0, 0, 0, 0.6),
    0 12px 30px -20px rgba(0, 0, 0, 0.45);
  animation: rise 0.7s ease 0.1s both;
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--grad);
}

.panel__head { margin-bottom: 1.5rem; }
.panel__head h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; color: var(--negro); }
.panel__head p { color: var(--gris); font-size: 0.95rem; margin-top: 0.35rem; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.field { margin-bottom: 1rem; display: flex; flex-direction: column; min-width: 0; }

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--gris);
}

.field input {
  width: 100%;
  min-width: 0;
  font-family: inherit;
  font-size: 0.98rem;
  padding: 0.8rem 0.95rem;
  border: 1.5px solid rgba(32, 32, 32, 0.14);
  border-radius: 12px;
  background: #f7fafa;
  color: var(--negro);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input::placeholder { color: #9aa0a0; }
.field input:hover { border-color: rgba(32, 32, 32, 0.26); }
.field input:focus {
  outline: none;
  border-color: var(--celeste);
  background: var(--blanco);
  box-shadow: 0 0 0 4px rgba(16, 175, 217, 0.14);
}
.field input.invalid {
  border-color: #e4572e;
  box-shadow: 0 0 0 4px rgba(228, 87, 46, 0.12);
}
.field .error-msg {
  color: #e4572e;
  font-size: 0.78rem;
  margin-top: 0.3rem;
  min-height: 0;
}

.submit {
  position: relative;
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.95rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: var(--grad);
  background-size: 180% 180%;
  color: var(--blanco);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.25s, background-position 0.5s;
  box-shadow: 0 16px 30px -14px rgba(16, 175, 217, 0.6);
}
.submit:hover {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 20px 38px -14px rgba(16, 175, 217, 0.7);
}
.submit:active { transform: translateY(0); }
.submit:focus-visible { outline: 3px solid rgba(16, 175, 217, 0.5); outline-offset: 2px; }
.submit:disabled { cursor: wait; opacity: 0.85; }

.submit__spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--blanco);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 0.6rem;
  vertical-align: middle;
}
.submit.loading .submit__spinner { display: inline-block; }
.submit.loading .submit__text { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-note {
  text-align: center;
  font-size: 0.78rem;
  color: #9aa0a0;
  margin-top: 0.9rem;
}

.success { text-align: center; padding: 1rem 0.5rem; animation: rise 0.5s ease; }
.success__check {
  width: 64px; height: 64px;
  margin: 0 auto 1.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad);
  color: var(--blanco);
  font-size: 2rem;
  font-weight: 700;
  box-shadow: 0 16px 34px -14px rgba(163, 213, 18, 0.55);
  animation: pop 0.5s cubic-bezier(.2,1.2,.3,1);
}
.success h2 { font-size: 1.4rem; margin-bottom: 0.6rem; color: var(--negro); }
.success p { color: var(--gris); max-width: 24rem; margin: 0 auto 1.25rem; line-height: 1.55; }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }

.link-btn {
  background: none;
  border: none;
  color: var(--celeste);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.4rem clamp(1.25rem, 5vw, 4rem);
  font-size: 0.82rem;
  color: var(--on-dark-faint);
  border-top: 1px solid var(--line-dark);
}
.site-footer__tag {
  font-weight: 600;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 2.5rem; align-items: start; }
  .intro { max-width: 36rem; margin-inline: auto; }
  .chat { margin-inline: auto; }
  .panel { max-width: 36rem; margin-inline: auto; width: 100%; }
}

@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; }
  .site-header { justify-content: space-between; }
  .site-footer { justify-content: center; text-align: center; }
  .chat__bubble { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
  .bg__glow, .status__dot { animation: none; }
  .intro, .panel, .success { animation: none; }
  .chat__bubble { opacity: 1; transform: none; animation: none; }
  .chat__typing { display: none; }
}
