:root{
  --blue:#0055b8;
  --cyan:#009ade;
  --navy:#073f86;
  --ink:#102742;
  --muted:#64748b;
  --soft:#eef7ff;
  --soft2:#f7fbff;
  --line:#d9eaf8;
  --white:#fff;
  --danger:#d92525;
  --radius:24px;
  --shadow:0 18px 45px rgba(0,85,184,.16);
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:"Acumin Variable Concept","Acumin Pro",Arial,sans-serif;
  color:var(--ink);
  background:radial-gradient(circle at 15% -10%,rgba(0,154,222,.28),transparent 34%),linear-gradient(180deg,#edf7ff 0%,#fff 58%);
  min-height:100vh;
}

body:before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:linear-gradient(135deg,rgba(0,85,184,.08),transparent 42%);
}

a{
  color:inherit;
}

.wrap{
  width:min(1100px,92vw);
  margin:0 auto;
}

.shell{
  min-height:100vh;
  display:grid;
  grid-template-rows:auto 1fr auto;
}

.topbar{
  padding:24px 0 10px;
}

.brand{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.brand img{
  width:190px;
  max-width:48vw;
  height:auto;
  display:block;
}

.branch{
  font-weight:900;
  color:var(--blue);
  font-size:12px;
  letter-spacing:.12em;
  text-transform:uppercase;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.72);
  padding:10px 14px;
}

.panel{
  background:rgba(255,255,255,.92);
  border:1px solid rgba(217,234,248,.9);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.hero{
  position:relative;
  overflow:hidden;
  background:linear-gradient(135deg,var(--blue),var(--cyan));
  color:#fff;
  padding:34px;
}

.hero:before{
  content:"";
  position:absolute;
  width:270px;
  height:270px;
  left:-130px;
  top:-140px;
  border-radius:0 0 160px 0;
  background:rgba(7,63,134,.35);
}

.hero:after{
  content:"";
  position:absolute;
  width:140px;
  height:140px;
  right:-55px;
  bottom:-65px;
  border-radius:100px 0 0 0;
  background:rgba(255,255,255,.14);
}

.hero>*{
  position:relative;
  z-index:1;
}

.eyebrow{
  font-size:12px;
  font-weight:900;
  letter-spacing:.14em;
  text-transform:uppercase;
  opacity:.86;
  margin:0 0 12px;
}

.hero h1{
  margin:0;
  font-family:"Integral CF","Arial Black",Arial,sans-serif;
  font-style:italic;
  text-transform:uppercase;
  letter-spacing:-1.3px;
  line-height:.96;
  font-size:clamp(34px,6vw,64px);
}

.hero p{
  margin:16px 0 0;
  max-width:760px;
  color:#eef9ff;
  line-height:1.45;
  font-size:16px;
}

#descripcionPaso{
  white-space:pre-line;
}

.content{
  padding:28px 34px;
}

.steps{
  display:flex;
  gap:8px;
  align-items:center;
  margin-bottom:18px;
  overflow:auto;
  padding-bottom:2px;
}

.step{
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
  border:1px solid var(--line);
  background:#fff;
  border-radius:999px;
  padding:8px 12px;
  font-weight:900;
  color:var(--muted);
  font-size:12px;
}

.step b{
  display:grid;
  place-items:center;
  width:22px;
  height:22px;
  border-radius:999px;
  background:#eef8ff;
  color:var(--blue);
}

.step.active{
  color:var(--blue);
  border-color:rgba(0,85,184,.25);
  box-shadow:0 8px 18px rgba(0,85,184,.08);
}

.grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}

.grid-3{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

.field{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.field label{
  font-weight:900;
  color:var(--blue);
  font-size:13px;
}

.field input,
.field select,
.field textarea{
  width:100%;
  border:1.5px solid var(--line);
  border-radius:16px;
  padding:15px 15px;
  font:inherit;
  font-size:15px;
  background:#fff;
  color:var(--ink);
  outline:none;
  transition:.18s;
}

.field textarea{
  min-height:95px;
  resize:vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color:var(--cyan);
  box-shadow:0 0 0 4px rgba(0,154,222,.12);
}

.help{
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
}

.actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-top:24px;
  flex-wrap:wrap;
}

.btn{
  appearance:none;
  border:0;
  border-radius:16px;
  padding:15px 22px;
  font-weight:900;
  font-size:14px;
  letter-spacing:.02em;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:52px;
  transition:.18s;
}

.btn-primary{
  background:var(--blue);
  color:#fff;
  box-shadow:0 12px 22px rgba(0,85,184,.24);
}

.btn-primary:hover{
  transform:translateY(-1px);
  background:#00499d;
}

.btn-light{
  background:#eef8ff;
  color:var(--blue);
  border:1px solid var(--line);
}

.btn:disabled,
.btn.disabled{
  pointer-events:none;
  opacity:.45;
}

.section-card{
  border:1px solid var(--line);
  border-radius:22px;
  background:#fff;
  overflow:hidden;
  margin:18px 0;
}

.section-title{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 18px;
  background:linear-gradient(135deg,#f4fbff,#fff);
  border-bottom:1px solid var(--line);
}

.section-title span{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:999px;
  background:var(--blue);
  color:#fff;
  font-family:"Integral CF","Arial Black";
  font-style:italic;
  font-weight:900;
}

.section-title h2{
  font-family:"Integral CF","Arial Black",Arial,sans-serif;
  font-style:italic;
  text-transform:uppercase;
  font-size:18px;
  color:var(--blue);
  margin:0;
  letter-spacing:-.3px;
}

.section-body{
  padding:18px;
}

.check-row{
  display:grid;
  grid-template-columns:24px 1fr;
  gap:11px;
  padding:12px 0;
  border-bottom:1px solid #edf4fa;
  color:var(--muted);
  line-height:1.34;
  cursor:pointer;
}

.check-row:last-child{
  border-bottom:0;
}

.check-row strong{
  color:#50637e;
}

.check-row input.fakebox{
  appearance:none;
  -webkit-appearance:none;
  width:22px;
  height:22px;
  min-width:22px;
  border:2px solid var(--cyan);
  border-radius:7px;
  background:#fff;
  margin:1px 0 0 0;
  cursor:pointer;
  display:inline-grid;
  place-content:center;
  transition:.18s;
}

.check-row input.fakebox:hover{
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(0,154,222,.12);
}

.check-row input.fakebox:focus{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(0,154,222,.18);
}

.check-row input.fakebox:checked{
  background:var(--cyan);
  border-color:var(--cyan);
}

.check-row input.fakebox:checked::before{
  content:"";
  width:6px;
  height:11px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
  margin-top:-2px;
}

.fakebox{
  width:19px;
  height:19px;
  border:2px solid var(--cyan);
  border-radius:6px;
  margin-top:1px;
}

.pill{
  display:inline-flex;
  border-radius:999px;
  background:#eef8ff;
  color:var(--blue);
  padding:5px 9px;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
  margin-right:6px;
}

ul.compact{
  margin:6px 0 0 18px;
  padding:0;
  color:var(--muted);
}

ul.compact li{
  margin:5px 0;
}

.confirm{
  display:flex;
  gap:10px;
  align-items:flex-start;
  background:#f8fcff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  margin-top:18px;
  cursor:pointer;
}

.confirm input{
  width:20px;
  height:20px;
  accent-color:var(--blue);
  flex:none;
}

#confirmacionInfo{
  appearance:none;
  -webkit-appearance:none;
  width:22px;
  height:22px;
  min-width:22px;
  border:2px solid var(--cyan);
  border-radius:7px;
  background:#fff;
  margin:1px 0 0 0;
  cursor:pointer;
  display:inline-grid;
  place-content:center;
  transition:.18s;
  flex:none;
}

#confirmacionInfo:hover{
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(0,154,222,.12);
}

#confirmacionInfo:focus{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 4px rgba(0,154,222,.18);
}

#confirmacionInfo:checked{
  background:var(--cyan);
  border-color:var(--cyan);
}

#confirmacionInfo:checked::before{
  content:"";
  width:6px;
  height:11px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
  margin-top:-2px;
}

.required{
  color:var(--danger);
}

.footer{
  padding:24px 0 34px;
  color:var(--muted);
  font-size:13px;
  text-align:center;
}

/* MODAL CONTRATO */
.modal-contrato{
  position:fixed;
  inset:0;
  z-index:9999;
}

.modal-contrato[hidden]{
  display:none;
}

.modal-contrato-overlay{
  position:absolute;
  inset:0;
  background:rgba(16,39,66,.62);
  backdrop-filter:blur(4px);
}

.modal-contrato-content{
  position:relative;
  z-index:1;
  width:min(980px,94vw);
  max-height:92vh;
  margin:4vh auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:24px;
  box-shadow:0 24px 70px rgba(7,63,134,.34);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.modal-contrato-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:22px 24px;
  background:linear-gradient(135deg,var(--blue),var(--cyan));
  color:#fff;
}

.modal-contrato-header .eyebrow{
  margin:0 0 8px;
  color:#eef9ff;
}

.modal-contrato-header h2{
  margin:0;
  font-family:"Integral CF","Arial Black",Arial,sans-serif;
  font-style:italic;
  text-transform:uppercase;
  letter-spacing:-.5px;
  line-height:1;
}

.modal-contrato-close{
  appearance:none;
  border:0;
  width:42px;
  height:42px;
  border-radius:999px;
  background:rgba(255,255,255,.18);
  color:#fff;
  font-size:30px;
  line-height:1;
  cursor:pointer;
  transition:.18s;
}

.modal-contrato-close:hover{
  background:rgba(255,255,255,.28);
  transform:translateY(-1px);
}

.modal-contrato-body{
  padding:22px 24px;
  overflow:auto;
}

/* PDF */
.pdf-toolbar{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  margin:10px 0 12px;
}

.btn-pdf-zoom{
  width:44px;
  min-height:42px;
  padding:8px 12px;
  border-radius:12px;
  font-size:22px;
  line-height:1;
}

.pdf-zoom-label{
  min-width:58px;
  text-align:center;
  font-weight:900;
  color:var(--blue);
  font-size:14px;
}

.pdf-viewer{
  width:100%;
  max-height:52vh;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid var(--line);
  border-radius:18px;
  background:#f8fcff;
  padding:14px;
}

.pdf-viewer canvas{
  display:block;
  max-width:none !important;
  width:auto !important;
  height:auto !important;
  margin:0 auto 16px;
  border-radius:10px;
  box-shadow:0 8px 20px rgba(16,39,66,.12);
  background:#fff;
}

/* FIRMA */
.signature-box{
  width:100%;
  height:220px;
  border:2px solid rgba(0,102,204,.18);
  border-radius:18px;
  background:#fff;
  overflow:hidden;
  position:relative;
}

#signature-pad{
  width:100%;
  height:220px;
  display:block;
  background:#fff;
  cursor:crosshair;
  touch-action:none;
  -ms-touch-action:none;
}

/* MODAL CIERRE */
.modal-cierre{
  position:fixed;
  inset:0;
  z-index:10000;
}

.modal-cierre[hidden]{
  display:none;
}

.modal-cierre-overlay{
  position:absolute;
  inset:0;
  background:rgba(10,25,45,.58);
  backdrop-filter:blur(4px);
}

.modal-cierre-content{
  position:relative;
  width:min(520px,calc(100% - 28px));
  margin:9vh auto 0;
  background:#fff;
  border-radius:24px;
  box-shadow:0 24px 80px rgba(0,0,0,.25);
  overflow:hidden;
  animation:modalCierreIn .18s ease-out;
}

.modal-cierre-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:22px 24px;
  border-bottom:1px solid rgba(0,0,0,.08);
}

.modal-cierre-header h2{
  margin:0;
  color:var(--blue);
}

.modal-cierre-close{
  width:40px;
  height:40px;
  border:0;
  border-radius:12px;
  background:#f3f7fb;
  color:var(--blue);
  font-size:30px;
  line-height:1;
  cursor:pointer;
}

.modal-cierre-body{
  padding:24px;
  color:#26384d;
  font-size:16px;
  line-height:1.55;
}

.modal-cierre-body p{
  margin:0;
}

.modal-cierre-footer{
  padding:18px 24px 24px;
  display:flex;
  justify-content:flex-end;
}

@keyframes modalCierreIn{
  from{
    opacity:0;
    transform:translateY(12px) scale(.98);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

/* BLOQUEOS DE SCROLL */
body.modal-abierto,
body.firmando-contrato{
  overflow:hidden;
}

/* RESPONSIVE */
@media (max-width:760px){
  .grid,
  .grid-3{
    grid-template-columns:1fr;
  }

  .content{
    padding:22px 18px;
  }

  .hero{
    padding:28px 20px;
  }

  .actions{
    align-items:stretch;
  }

  .btn{
    width:100%;
  }

  .branch{
    font-size:10px;
  }

  .brand img{
    width:160px;
  }

  .modal-contrato-content{
    width:94vw;
    height:calc(100dvh - 24px);
    max-height:calc(100dvh - 24px);
    margin:12px auto;
    border-radius:20px;
  }

  .modal-contrato-body{
    flex:1;
    overflow:auto;
    padding:18px;
    padding-bottom:calc(34px + env(safe-area-inset-bottom));
  }

  .signature-box{
    height:170px;
  }

  #signature-pad{
    height:170px;
  }

  .modal-contrato-body .actions{
    margin-top:18px;
    padding-bottom:18px;
  }

  @supports not (height: 100dvh){
    @media (max-width:760px){
      .modal-contrato-content{
        height:calc(100vh - 24px);
        max-height:calc(100vh - 24px);
      }
    }
  }

  .modal-cierre-content{
    margin:7vh auto 0;
    border-radius:20px;
  }

  .modal-cierre-header,
  .modal-cierre-body,
  .modal-cierre-footer{
    padding-left:18px;
    padding-right:18px;
  }

  .modal-cierre-footer .btn{
    width:100%;
  }
}