/* ==========================================================================
   Fratelliscuola · formularios
   Misma paleta y tipografía que la landing (Fraunces + Inter).
   ========================================================================== */

:root{
  --ivory:#FAF6EE;
  --ivory-dark:#F2EBDD;
  --ivory-deep:#E9DFCB;
  --navy:#1E3A5F;
  --navy-deep:#0F2038;
  --gold:#E0A93B;
  --gold-dark:#C8922C;
  --terracotta:#A0522D;
  --leather:#5C3D2E;
  --line:rgba(30,58,95,.14);
  --line-strong:rgba(30,58,95,.28);
  --paper:#fffdf8;
  --maxw:640px;
  --pad:clamp(20px,5vw,32px);
  --serif:"Fraunces",ui-serif,Georgia,"Times New Roman",serif;
  --sans:"Inter",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  --r:3px;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;background:var(--ivory);color-scheme:light}
body{
  margin:0;background:var(--ivory);color:var(--leather);
  font-family:var(--sans);font-size:16px;line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%;display:block;height:auto}
button{font:inherit}
a{color:inherit}
h1,h2,h3{font-family:var(--serif);color:var(--navy);font-weight:400;margin:0;letter-spacing:-.02em}
p{margin:0}
:focus-visible{outline:2px solid var(--terracotta);outline-offset:3px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* ---------- estructura ---------- */
.top{
  position:sticky;top:0;z-index:20;background:rgba(250,246,238,.94);
  backdrop-filter:saturate(140%) blur(8px);
  border-bottom:1px solid var(--line);
}
.top__in{
  max-width:var(--maxw);margin:0 auto;padding:12px var(--pad);
  display:flex;align-items:center;justify-content:space-between;gap:16px;
}
.top__logo{display:block}
.top__logo img{height:42px;width:auto}
.top__meta{
  font-size:.625rem;font-weight:600;letter-spacing:.16em;text-transform:uppercase;
  color:rgba(92,61,46,.66);text-align:right;line-height:1.5;
}
.progress{height:3px;background:rgba(30,58,95,.10);position:relative;overflow:hidden}
.progress__bar{height:100%;width:0;background:var(--gold);transition:width .45s cubic-bezier(.22,.61,.36,1)}

main{max-width:var(--maxw);margin:0 auto;padding:clamp(26px,5vw,44px) var(--pad) 96px}

/* ---------- cabecera del paso ---------- */
.step__eyebrow{
  display:inline-flex;align-items:center;gap:.7rem;
  font-size:.6875rem;font-weight:600;letter-spacing:.18em;text-transform:uppercase;
  color:var(--terracotta);line-height:1;
}
.step__eyebrow::before{content:"";width:1.5rem;height:1px;background:currentColor;opacity:.55}
.step__title{
  font-size:clamp(1.5rem,4.4vw,2.05rem);line-height:1.14;letter-spacing:-.025em;
  margin-top:1rem;text-wrap:balance;
}
.step__title em{font-style:italic;color:var(--terracotta)}
.step__help{
  margin-top:.85rem;font-size:.9375rem;line-height:1.6;color:rgba(92,61,46,.85);
  max-width:46ch;text-wrap:pretty;
}
.step__help + .step__help{margin-top:.5rem}

/* ---------- preguntas ---------- */
.q{margin-top:clamp(22px,4vw,32px);border:0;padding:0;scroll-margin-top:88px}
.q + .q{margin-top:clamp(24px,4vw,34px)}
.q__label{
  display:block;font-size:.9375rem;font-weight:600;color:var(--navy);
  line-height:1.45;margin-bottom:.55rem;letter-spacing:-.005em;
}
.q__label span{font-weight:500;color:rgba(92,61,46,.55);font-size:.8125rem}
.q__help{font-size:.8125rem;line-height:1.55;color:rgba(92,61,46,.72);margin:-.2rem 0 .7rem;max-width:48ch}
.q__help strong{color:var(--navy);font-weight:600}

.field{
  width:100%;min-height:54px;padding:.85rem 1rem;
  background:var(--paper);border:1px solid var(--line-strong);border-radius:var(--r);
  font-family:var(--sans);font-size:1rem;color:var(--navy-deep);
  transition:border-color .16s ease, box-shadow .16s ease;
  appearance:none;
}
.field::placeholder{color:rgba(92,61,46,.52)}
.field:hover{border-color:rgba(30,58,95,.45)}
.field:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 3px rgba(224,169,59,.22)}
textarea.field{min-height:96px;resize:vertical;line-height:1.55}
select.field{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231E3A5F' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 1rem center;padding-right:2.6rem;
}

/* ---------- telefono con prefijo ---------- */
.phone{display:grid;grid-template-columns:minmax(0,44%) minmax(0,1fr);gap:.5rem}
.phone__pais{font-size:.9375rem;padding-right:2.2rem}
.phone__num{font-variant-numeric:tabular-nums;letter-spacing:.01em}
@media (max-width:400px){
  .phone{grid-template-columns:1fr}
}

/* ---------- opciones ---------- */
.opts{display:grid;gap:.5rem}
.opts--grid{grid-template-columns:1fr 1fr}
.opt{
  position:relative;display:flex;align-items:center;gap:.8rem;
  min-height:52px;padding:.8rem 1rem;
  background:var(--paper);border:1px solid var(--line-strong);border-radius:var(--r);
  font-size:.9375rem;line-height:1.4;color:var(--navy-deep);cursor:pointer;
  transition:border-color .14s ease,background .14s ease,transform .14s ease;
  text-align:left;width:100%;
}
.opt:hover{border-color:rgba(30,58,95,.5)}
.opt:active{transform:scale(.995)}
.opt__box{
  flex:0 0 auto;width:20px;height:20px;border:1px solid var(--line-strong);border-radius:50%;
  background:#fff;position:relative;transition:border-color .14s ease,background .14s ease;
}
.opt__text{flex:1}
.opt__hint{display:block;font-size:.75rem;color:rgba(92,61,46,.6);margin-top:.15rem}
.opt[aria-checked="true"]{border-color:var(--gold);background:#FDF6E7}
.opt[aria-checked="true"] .opt__box{border-color:var(--gold-dark);background:var(--gold)}
.opt[aria-checked="true"] .opt__box::after{
  content:"";position:absolute;inset:0;margin:auto;width:7px;height:7px;border-radius:50%;background:var(--navy-deep);
}
.opt--multi .opt__box{border-radius:3px}
.opt--multi[aria-checked="true"] .opt__box::after{
  width:11px;height:6px;border:0;border-left:2px solid var(--navy-deep);border-bottom:2px solid var(--navy-deep);
  border-radius:0;background:none;transform:rotate(-45deg) translate(1px,-1px);
}
.opt--consent{align-items:flex-start;padding-top:.95rem;padding-bottom:.95rem;font-size:.875rem;line-height:1.55}
.opt--consent .opt__box{margin-top:1px}
.opt--consent a{color:var(--terracotta);text-underline-offset:2px}

/* ---------- pie de paso ---------- */
.nav{display:flex;flex-direction:column;gap:0;margin-top:clamp(26px,5vw,38px)}
.nav__row{display:flex;align-items:center;gap:12px;width:100%}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.6rem;
  min-height:56px;padding:1rem 1.7rem;flex:1;
  background:var(--gold);color:var(--navy-deep);border:1px solid var(--gold);
  font-size:1rem;font-weight:600;border-radius:var(--r);cursor:pointer;
  transition:background .18s ease,color .18s ease,border-color .18s ease,opacity .18s ease;
}
.btn:hover{background:var(--navy);border-color:var(--navy);color:var(--ivory)}
.btn[disabled]{cursor:not-allowed;background:var(--ivory-deep);border-color:rgba(30,58,95,.22);color:rgba(15,32,56,.6)}
.btn__arrow{font-weight:400}
.back{
  background:none;border:0;padding:.5rem .25rem;color:rgba(92,61,46,.72);
  font-size:.875rem;cursor:pointer;text-decoration:underline;text-underline-offset:3px;
}
.back:hover{color:var(--navy)}
.nav__note{margin-top:.9rem;font-size:.75rem;color:rgba(92,61,46,.55);text-align:center}

/* ---------- errores ---------- */
.error{
  display:none;margin-top:.45rem;font-size:.8125rem;color:#9A2F1B;font-weight:500;
}
.error.is-on{display:block}
.q.has-error .field,.q.has-error .opt{border-color:#C4553D}

/* ---------- intro ---------- */
.intro__title{font-size:clamp(1.85rem,5.4vw,2.6rem);line-height:1.08;letter-spacing:-.028em;text-wrap:balance}
.intro__title em{font-style:italic;color:var(--terracotta)}
.intro__lead{margin-top:1.1rem;font-size:1.0625rem;line-height:1.65;color:rgba(92,61,46,.9);max-width:44ch}
.intro__list{margin:1.5rem 0 0;padding:0;list-style:none;display:grid;gap:.6rem}
.intro__list li{display:flex;gap:.7rem;font-size:.9375rem;line-height:1.5;color:rgba(92,61,46,.9)}
.intro__list svg{flex:0 0 auto;margin-top:3px;color:var(--gold-dark)}
.intro__cta{margin-top:2rem}
.intro__time{margin-top:.9rem;font-size:.75rem;letter-spacing:.02em;color:rgba(92,61,46,.6)}
.intro__foot{margin-top:2.4rem;padding-top:1.4rem;border-top:1px solid var(--line);font-size:.8125rem;color:rgba(92,61,46,.62);line-height:1.6}

/* ---------- cierre ---------- */
.done{text-align:left;padding-top:clamp(10px,4vw,28px)}
.done__mark{
  width:52px;height:52px;border-radius:50%;background:var(--gold);
  display:flex;align-items:center;justify-content:center;margin-bottom:1.5rem;
}
.done__title{font-size:clamp(1.75rem,5vw,2.4rem);line-height:1.1;letter-spacing:-.025em;text-wrap:balance}
.done__title em{font-style:italic;color:var(--terracotta)}
.done__lead{margin-top:1rem;font-size:1rem;line-height:1.65;color:rgba(92,61,46,.9);max-width:46ch}
.next{margin-top:2rem;display:grid;gap:1.15rem}
.next__item{display:flex;gap:1rem}
.next__num{
  flex:0 0 auto;width:26px;height:26px;border-radius:50%;border:1px solid var(--line-strong);
  display:flex;align-items:center;justify-content:center;
  font-size:.6875rem;font-weight:600;color:var(--navy);
}
.next__text{font-size:.9375rem;line-height:1.55;color:rgba(92,61,46,.92)}
.next__text strong{color:var(--navy);font-weight:600}
.done__foot{margin-top:2.4rem;padding-top:1.4rem;border-top:1px solid var(--line);font-size:.8125rem;color:rgba(92,61,46,.66);line-height:1.65}
.done__foot a{color:var(--terracotta);text-underline-offset:2px}

/* ---------- pasos animados ---------- */
.step{display:none;animation:rise .3s cubic-bezier(.22,.61,.36,1) both}
.step.is-on{display:block}
@keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){
  .step{animation:none}
  .progress__bar{transition:none}
}

/* ---------- movil ---------- */
@media (max-width:560px){
  .opts--grid{grid-template-columns:1fr}
  .nav{
    position:sticky;bottom:0;margin-top:24px;padding:14px 0 14px;
    background:linear-gradient(to top, var(--ivory) 62%, rgba(250,246,238,.94));
    box-shadow:0 -18px 22px -8px var(--ivory);
  }
  .nav .btn{min-height:54px}
  .nav{gap:2px}
  main{padding-bottom:8px}
  .back{font-size:.8125rem}
}
@media (min-width:561px){
  .nav .btn{flex:0 0 auto;min-width:230px;margin-left:auto}
}

/* ---------- aviso de datos recuperados ---------- */
.recover{
  margin:0 0 1.4rem;padding:.7rem .9rem;border-left:2px solid var(--gold);
  background:#FDF6E7;font-size:.8125rem;line-height:1.5;color:rgba(92,61,46,.9);
}

/* ---------- barra de estado de envío ---------- */
.sending{opacity:.65;pointer-events:none}
.fatal{
  margin-top:1.5rem;padding:1rem 1.1rem;border:1px solid #C4553D;background:#FCF1EE;
  border-radius:var(--r);font-size:.875rem;color:#7E2A17;line-height:1.55;
}
