/* =========================================================
   /aplica — bienvenida con proyectos + 3 preguntas, una por pantalla
   Fondo oscuro de marca, texto grande, animaciones suaves. Usa los tokens de styles.css
   ========================================================= */
.apply-body { min-height: 100vh; min-height: 100dvh; background: var(--ink); color: #fff; color-scheme: dark; }

/* Fondo: portafolio desenfocado (una sola imagen ligera, ya desenfocada) + luces de marca */
.apply-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #0e0626 url("assets/aplica-bg.webp") center / cover no-repeat; }
.apply-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 70% at 50% 35%, rgba(14,6,38,.55), rgba(14,6,38,.92)); }
.apply-bg__orb { position: absolute; z-index: 1; border-radius: 50%; filter: blur(90px); opacity: .45; }
.apply-bg__orb--a { width: 520px; height: 520px; left: -180px; top: -160px; background: var(--brand); }
.apply-bg__orb--b { width: 440px; height: 440px; right: -160px; bottom: -160px; background: var(--brand-300); opacity: .3; }

/* ---------- Distribución: una columna centrada ---------- */
.apply {
  position: relative; z-index: 2; width: min(600px, 100%); margin: 0 auto;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: max(18px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
}
.apply__top { display: flex; align-items: center; gap: 18px; min-height: 44px; }
.apply__logo { flex: none; display: block; line-height: 0; }
.apply__logo img { height: 22px; width: auto; opacity: .95; }
.apply__progress { flex: 1; display: grid; gap: 7px; justify-items: end; animation: fadeIn .4s var(--ease) both; }
.apply__progress[hidden] { display: none; }
.apply__step-label { font-size: 13px; font-weight: 500; color: rgba(255,255,255,.72); }
.apply__bar { width: 100%; max-width: 220px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.apply__bar i { display: block; height: 100%; width: 33%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-400), var(--brand-200)); transition: width .5s var(--ease); }

.apply__form { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 28px 0 8px; outline: none; }

/* ---------- Pantallas ---------- */
.apply__step { display: grid; gap: 22px; text-align: center; }
.apply__step[hidden] { display: none; }
.apply__step.is-entering { animation: stepIn .5s var(--ease) both; }
.apply__step.is-entering.is-back { animation-name: stepBack; }
.apply__step.is-entering .chip,
.apply__step.is-entering .apply-case { animation: rise .55s var(--ease) both; animation-delay: calc(80ms + var(--i, 0) * 55ms); }

@keyframes stepIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes stepBack { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.apply__title {
  display: block; width: 100%; padding: 0; margin: 0;
  font-size: clamp(26px, 6.4vw, 34px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15;
  color: #fff; text-wrap: balance; outline: none;
}
.apply__title--xl { font-size: clamp(32px, 8.4vw, 46px); line-height: 1.05; }
.apply__lead { font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.75); margin-top: -8px; text-wrap: balance; }
.apply__time { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 14px; color: rgba(255,255,255,.66); margin-top: -6px; }
.apply__time svg { color: var(--brand-200); flex: none; }

/* ---------- Bienvenida: tarjetas de proyectos ---------- */
.apply-cases { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.apply-case {
  position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 5; text-align: left;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 24px 50px -24px rgba(0,0,0,.7);
}
.apply-case img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.apply-case::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,6,38,0) 40%, rgba(14,6,38,.92) 100%); }
.apply-case__text { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; display: grid; gap: 3px; padding: 12px 11px; }
.apply-case b { font-size: 13.5px; font-weight: 600; line-height: 1.2; color: #fff; }
.apply-case span { font-size: 12px; line-height: 1.3; color: rgba(255,255,255,.8); }
@media (hover: hover) { .apply-case:hover img { transform: scale(1.05); } }

/* ---------- Campos ---------- */
.field { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; text-align: left; }
.field[hidden] { display: none; }
.apply__step > .field > legend.apply__title { margin-bottom: 10px; text-align: center; }
.apply__step > .field > .apply__title { text-align: center; }
.apply__step > .field > .field__hint { text-align: center; margin: -2px 0 8px; }
.field__label { display: block; width: 100%; text-align: center; padding: 0; font-size: 15px; font-weight: 600; line-height: 1.4; color: #fff; }
legend.field__label { margin-bottom: 10px; }
.field__hint { font-size: 15px; line-height: 1.5; color: rgba(255,255,255,.7); }
.field__input {
  width: 100%; font: inherit; font-size: 17px; color: #fff; padding: 15px 16px; border-radius: 16px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); outline: none; appearance: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field__input::placeholder { color: rgba(255,255,255,.42); }
.field__input:focus { border-color: var(--brand-300); background: rgba(255,255,255,.12); box-shadow: 0 0 0 4px rgba(160,127,255,.22); }
.select { position: relative; display: block; }
.select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid rgba(255,255,255,.7); border-bottom: 2px solid rgba(255,255,255,.7); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select select { padding-right: 40px; cursor: pointer; }
.select select option { color: #0e0626; background: #fff; }
.field__error { display: none; font-style: normal; font-size: 14px; line-height: 1.4; color: #ff9db3; text-align: center; }
.field.has-error > .field__input, .field.has-error .phone .field__input, .field.has-error .money { border-color: #ff7a98; box-shadow: 0 0 0 4px rgba(255,122,152,.16); }
.field.has-error > .field__error { display: block; animation: fadeIn .25s ease both; }
.field.has-error .chip span { border-color: rgba(255,122,152,.6); }

/* Presupuesto: $ ___ MXN al mes */
.money {
  display: flex; align-items: center; gap: 8px; padding: 0 18px; border-radius: 20px; margin-top: 4px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); transition: border-color .2s, box-shadow .2s, background .2s;
}
.money:focus-within { border-color: var(--brand-300); background: rgba(255,255,255,.12); box-shadow: 0 0 0 4px rgba(160,127,255,.22); }
.money__sign { font-size: 28px; font-weight: 600; color: rgba(255,255,255,.7); }
.money__input { flex: 1; min-width: 0; padding: 18px 0; border: 0; background: none; box-shadow: none; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.money__input:focus { background: none; box-shadow: none; }
.money__unit { flex: none; font-size: 14px; color: rgba(255,255,255,.62); }

/* Teléfono: código de país + número */
.phone { display: grid; grid-template-columns: minmax(118px, 36%) 1fr; gap: 8px; }
.select--country select { font-size: 15px; text-overflow: ellipsis; }

/* WhatsApp | Correo */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: 11px 12px; border-radius: 12px; font-size: 15px; font-weight: 500; color: rgba(255,255,255,.7); transition: background .25s, color .25s; }
.segmented input:checked + span { background: #fff; color: var(--ink); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px rgba(160,127,255,.5); }

/* Opciones */
.chips { display: grid; gap: 10px; }
.chip { position: relative; cursor: pointer; display: block; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-radius: 18px;
  font-size: 16px; line-height: 1.35; color: #fff;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16);
  transition: background .25s, border-color .25s, transform .2s var(--ease);
}
.chip span::before {
  content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.45); transition: border-color .25s, box-shadow .25s, background .25s;
}
.chip:active span { transform: scale(.985); }
@media (hover: hover) { .chip:hover span { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.3); } }
.chip input:checked + span { background: rgba(78,8,255,.55); border-color: var(--brand-300); }
.chip input:checked + span::before { border-color: #fff; background: #fff; box-shadow: inset 0 0 0 5px var(--brand); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(160,127,255,.55); }


/* Permiso newsletter */
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: rgba(255,255,255,.72); cursor: pointer; margin-top: 2px; }
.consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand-400); cursor: pointer; }

/* Botones */
.apply__actions { display: flex; gap: 10px; margin-top: 6px; }
.apply__actions > * { flex: 1; }
.apply__actions .apply__btn--ghost { flex: 0 0 auto; }
.apply__btn {
  display: inline-block; font: inherit; font-size: 16px; font-weight: 600; padding: 16px 26px; border-radius: 18px; border: 0;
  cursor: pointer; text-decoration: none; text-align: center; transition: background .2s, box-shadow .2s, opacity .2s, transform .2s var(--ease);
}
.apply__btn:active { transform: scale(.98); }
.apply__btn--primary { background: #fff; color: var(--ink); box-shadow: 0 16px 40px -16px rgba(160,127,255,.9); }
.apply__btn--primary:hover { background: var(--brand-50); }
.apply__btn--ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.14); }
.apply__btn--ghost:hover { background: rgba(255,255,255,.14); }
.apply__btn[disabled] { opacity: .6; cursor: progress; }
.apply__btn:focus-visible { outline: 3px solid var(--brand-300); outline-offset: 2px; }
.apply__form-error { font-size: 14px; color: #ffd0da; background: rgba(255,122,152,.14); border: 1px solid rgba(255,122,152,.35); padding: 11px 14px; border-radius: 14px; }

/* Pantallas finales */
.apply__step--done { justify-items: center; }
.apply__step--done .apply__actions { width: 100%; }
.apply__check { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: #fff; box-shadow: 0 0 0 12px rgba(160,127,255,.18); animation: pop .6s var(--ease) both .1s; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

@media (min-width: 720px) {
  .apply { padding-inline: 32px; }
  .apply__logo img { height: 26px; }
  .apply__step { gap: 26px; }
  .apply-cases { gap: 14px; }
  .apply-case { border-radius: 24px; }
  .apply-case__text { padding: 16px 14px; }
  .apply-case b { font-size: 15.5px; }
  .apply-case span { font-size: 13px; }
  .apply__step--welcome .apply__actions { width: 320px; margin-inline: auto; }
}
@media (max-width: 340px) { .phone { grid-template-columns: 1fr; } }
@media (max-width: 380px) {
  .apply { padding-inline: 14px; }
  .apply-cases { gap: 7px; }
  .apply-case b { font-size: 12.5px; }
  .apply-case span { font-size: 11px; }

}

@media (prefers-reduced-motion: reduce) {
  .apply__step.is-entering, .apply__step.is-entering .chip, .apply__step.is-entering .apply-case,
  .apply__progress, .apply__check, .field.has-error > .field__error { animation: none !important; }
  .apply__bar i, .apply-case img { transition: none; }
}
