/* HDI V5.14 - PORTAL MÓVIL FINAL
   Alcance:
   - Paleta móvil blanca / verde / rojo en tonos suaves.
   - Documentos sin columnas amontonadas en teléfono.
   - Barra del asegurado con Número de serie.
*/
:root{
  --hdi514-green:#087a46;
  --hdi514-green-2:#54a264;
  --hdi514-green-soft:#e8f5ec;
  --hdi514-green-soft-2:#f4faf6;
  --hdi514-red:#dc4f57;
  --hdi514-red-2:#e77d82;
  --hdi514-red-soft:#fdebed;
  --hdi514-ink:#17372d;
  --hdi514-muted:#66786f;
  --hdi514-line:#d9e9df;
  --hdi514-white:#fff;
}

/* ============================================================
   BARRA DE DATOS DEL ASEGURADO - 7 campos
   ============================================================ */
.pdd-case-strip{
  grid-template-columns:54px repeat(7,minmax(0,1fr))!important;
}
.pdd-case-strip-icon{
  background:#eaf5ee!important;
  color:var(--hdi514-green)!important;
}
.pdd-case-strip{
  border-color:#e6c6c8!important;
  box-shadow:0 10px 26px rgba(8,122,70,.07)!important;
}
.pdd-case-strip article{
  border-left-color:#e1ebe5!important;
}
.pdd-case-strip article span{
  color:#61766a!important;
}
.pdd-case-strip article strong{
  color:#17372d!important;
}

@media(max-width:1250px) and (min-width:701px){
  .pdd-case-strip{
    grid-template-columns:54px repeat(4,minmax(0,1fr))!important;
  }
  .pdd-case-strip-icon{
    grid-row:1/3!important;
    align-self:stretch!important;
    height:auto!important;
  }
  .pdd-case-strip article:nth-of-type(n+5){
    border-top:1px solid #e1ebe5!important;
  }
}

/* ============================================================
   MÓVIL - PALETA BLANCO / VERDE / ROJO SUAVE
   ============================================================ */
@media(max-width:700px){
  html,
  body,
  body.pdd-portal-ui{
    min-height:100%!important;
    background:#f4faf6!important;
    background-image:
      radial-gradient(circle at 88% 0,rgba(220,79,87,.10),transparent 26%),
      radial-gradient(circle at 4% 12%,rgba(84,162,100,.12),transparent 30%),
      linear-gradient(180deg,#fbfefc 0%,#edf7f0 100%)!important;
    color:var(--hdi514-ink)!important;
  }

  .pdd-portal-container{
    min-height:calc(100dvh - 52px)!important;
    background:transparent!important;
    color:var(--hdi514-ink)!important;
    padding:0 10px 26px!important;
  }

  /* Topbar más limpia y clara */
  .pdd-portal-topbar{
    min-height:58px!important;
    padding:8px 12px!important;
    background:linear-gradient(90deg,#fff 0%,#f2f9f4 68%,#fdeff0 100%)!important;
    border-bottom:1px solid #d8eadf!important;
    box-shadow:0 7px 18px rgba(8,122,70,.07)!important;
  }
  .pdd-brand-logo{
    width:128px!important;
    height:auto!important;
    filter:none!important;
  }
  .pdd-portal-actions #openManual,
  .pdd-portal-actions .pdd-logout-button{
    color:#315d49!important;
    font-size:9px!important;
    font-weight:850!important;
  }
  .pdd-portal-actions #openManual:hover,
  .pdd-portal-actions .pdd-logout-button:hover{
    color:var(--hdi514-red)!important;
  }

  .pt-v627-mobile-home{
    color:var(--hdi514-ink)!important;
    padding-bottom:14px!important;
  }

  /* Hero móvil blanco con acentos HDI suaves */
  .pt-v627-mobile-summary{
    margin:0 -10px 14px!important;
    padding:20px 20px 18px!important;
    border:1px solid #cfe4d6!important;
    border-top:4px solid var(--hdi514-green)!important;
    border-bottom:4px solid var(--hdi514-red)!important;
    border-radius:0 0 24px 24px!important;
    background:
      radial-gradient(circle at 92% 12%,rgba(220,79,87,.08),transparent 26%),
      radial-gradient(circle at 5% 88%,rgba(84,162,100,.08),transparent 28%),
      #fff!important;
    box-shadow:0 14px 28px rgba(8,122,70,.10)!important;
  }

  .pt-v627-mobile-eyebrow{
    color:var(--hdi514-green)!important;
  }
  .pt-v627-mobile-summary h1{
    color:var(--hdi514-ink)!important;
  }

  .pt-v627-mobile-case-data{
    grid-template-columns:1fr 1fr!important;
    gap:8px 12px!important;
  }
  .pt-v627-mobile-case-data>div{
    min-width:0!important;
    padding:7px 8px!important;
    border:1px solid #e1ece5!important;
    border-radius:9px!important;
    display:block!important;
    background:#fbfefc!important;
  }
  .pt-v627-mobile-case-data span{
    display:block!important;
    margin-bottom:2px!important;
    color:var(--hdi514-red)!important;
    font-size:8px!important;
    line-height:1.1!important;
    font-weight:900!important;
  }
  .pt-v627-mobile-case-data strong{
    display:block!important;
    color:#244438!important;
    font-size:9px!important;
    line-height:1.2!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  .pt-v627-mobile-intro{
    color:#50685c!important;
    font-size:11px!important;
  }

  .pt-v627-mobile-status{
    border:1px solid #b9d9c4!important;
    background:var(--hdi514-green-soft-2)!important;
    box-shadow:none!important;
  }
  .pt-v627-mobile-status span{
    color:#4d725f!important;
  }
  .pt-v627-mobile-status strong{
    color:var(--hdi514-green)!important;
  }
  .pt-v627-mobile-status small{
    color:#6f8077!important;
  }

  /* Barra: logrado verde suave, actual rojo suave, pendiente blanco */
  .pt-v627-mobile-progress{
    margin:0 0 14px!important;
    min-height:66px!important;
    border:1px solid #d3e5d9!important;
    border-radius:14px!important;
    background:#fff!important;
    box-shadow:0 8px 18px rgba(8,122,70,.06)!important;
  }
  .pt-v627-progress-item{
    border-right:1px solid #e4ede7!important;
    background:#fff!important;
    color:#9aa8a1!important;
    box-shadow:none!important;
  }
  .pt-v627-progress-item.is-reached{
    color:var(--hdi514-green)!important;
    background:var(--hdi514-green-soft)!important;
  }
  .pt-v627-progress-item.is-current{
    color:#fff!important;
    background:linear-gradient(180deg,#e77d82,#d94e56)!important;
    box-shadow:inset 0 -3px 0 rgba(143,25,31,.16)!important;
  }
  .pt-v627-progress-item.is-current i,
  .pt-v627-progress-item.is-current span{
    color:#fff!important;
  }

  /* Acciones: tarjetas blancas, icono blanco en fondo verde */
  .pt-v627-mobile-actions{
    gap:10px!important;
  }
  .pt-v627-mobile-action,
  button.pt-v627-mobile-action,
  div.pt-v627-mobile-action{
    min-height:70px!important;
    padding:10px 14px 10px 70px!important;
    border:1px solid #cfe3d6!important;
    border-left:4px solid var(--hdi514-green)!important;
    border-radius:14px!important;
    background:#fff!important;
    color:var(--hdi514-ink)!important;
    box-shadow:0 8px 18px rgba(8,122,70,.06)!important;
  }
  .pt-v627-mobile-action:nth-child(even){
    border-left-color:var(--hdi514-red)!important;
  }
  .pt-v627-mobile-action:active,
  button.pt-v627-mobile-action:hover,
  button.pt-v627-mobile-action:focus{
    border-color:#a9d1b8!important;
    background:#f7fbf8!important;
    color:var(--hdi514-ink)!important;
    box-shadow:0 8px 18px rgba(8,122,70,.08)!important;
  }
  .pt-v627-mobile-step{
    top:5px!important;
    color:#93a49b!important;
  }
  .pt-v627-mobile-action-icon{
    left:22px!important;
    width:38px!important;
    height:38px!important;
    border-radius:10px!important;
    display:grid!important;
    place-items:center!important;
    background:var(--hdi514-green)!important;
    color:#fff!important;
    box-shadow:0 7px 15px rgba(8,122,70,.16)!important;
  }
  .pt-v627-mobile-action:nth-child(even) .pt-v627-mobile-action-icon{
    background:var(--hdi514-red)!important;
    box-shadow:0 7px 15px rgba(220,79,87,.14)!important;
  }
  .pt-v627-mobile-action-icon i{
    color:#fff!important;
  }
  .pt-v627-mobile-action-copy strong{
    color:#17372d!important;
    font-size:15px!important;
  }
  .pt-v627-mobile-action-copy small{
    color:#718077!important;
    font-size:8px!important;
    white-space:normal!important;
    line-height:1.25!important;
  }
  .pt-v627-mobile-action.is-disabled{
    opacity:.62!important;
    background:#f7faf8!important;
  }

  /* ==========================================================
     DOCUMENTOS - ventana full width y flujo vertical
     ========================================================== */
  #documentos.pdd-portal-modal-panel{
    padding:0!important;
    align-items:stretch!important;
    justify-content:stretch!important;
    overflow:hidden!important;
    background:rgba(17,58,41,.52)!important;
  }

  #documentos .pdd-portal-modal-card{
    width:100vw!important;
    max-width:100vw!important;
    height:100dvh!important;
    max-height:100dvh!important;
    margin:0!important;
    padding:14px 12px 26px!important;
    border:0!important;
    border-radius:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    background:#f8fcf9!important;
    box-shadow:none!important;
  }

  #documentos .pdd-portal-modal-close{
    position:sticky!important;
    top:0!important;
    z-index:20!important;
    width:42px!important;
    height:42px!important;
    margin:0 0 -42px auto!important;
    border-radius:12px!important;
    background:var(--hdi514-red)!important;
    color:#fff!important;
  }
  #documentos .pdd-portal-modal-close i{
    color:#fff!important;
  }

  #documentos .pdd-panel-heading{
    margin:0 0 12px!important;
    padding:8px 50px 12px 4px!important;
    display:block!important;
    border-bottom:1px solid #dceadf!important;
    background:transparent!important;
  }
  #documentos .pdd-section-kicker{
    color:var(--hdi514-green)!important;
  }
  #documentos .pdd-panel-heading h2{
    margin:3px 0 4px!important;
    color:var(--hdi514-ink)!important;
    font-size:1.45rem!important;
  }
  #documentos .pdd-panel-heading p{
    margin:0!important;
    color:#6e7d75!important;
    font-size:.78rem!important;
    line-height:1.35!important;
  }
  #documentos .pdd-panel-badge{
    display:inline-flex!important;
    margin-top:10px!important;
    color:var(--hdi514-green)!important;
    background:var(--hdi514-green-soft)!important;
    border-color:#cfe4d6!important;
  }

  #documentos .pdd-required-summary,
  #documentos .pdd-doc-source-banner,
  #documentos .pdd-required-checklist,
  #documentos .pdd-upload-form,
  #documentos .pdd-documents-heading,
  #documentos .pdd-documents-list,
  #documentos .hdi-v513-format-toolbar{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:0!important;
    margin-right:0!important;
    box-sizing:border-box!important;
  }

  #documentos .pdd-required-summary{
    padding:13px!important;
    border:1px solid #cfe4d6!important;
    border-radius:13px!important;
    background:#fff!important;
  }
  #documentos .pdd-required-summary strong{
    color:var(--hdi514-green)!important;
  }
  #documentos .pdd-required-summary small{
    color:#66786f!important;
    white-space:normal!important;
  }
  #documentos .pdd-required-meter{
    background:#e7f0ea!important;
  }
  #documentos .pdd-required-meter i{
    background:linear-gradient(90deg,var(--hdi514-green-2),var(--hdi514-red-2))!important;
  }

  #documentos .pdd-doc-source-banner{
    padding:12px!important;
    display:grid!important;
    grid-template-columns:34px minmax(0,1fr)!important;
    gap:9px!important;
    border:1px solid #e2d2d3!important;
    border-radius:12px!important;
    background:#fff!important;
  }
  #documentos .pdd-doc-source-banner>i{
    color:var(--hdi514-red)!important;
  }
  #documentos .pdd-doc-source-banner strong{
    color:var(--hdi514-ink)!important;
  }
  #documentos .pdd-doc-source-banner span{
    color:#6d7d75!important;
    font-size:.72rem!important;
    line-height:1.35!important;
  }

  #documentos .pdd-required-checklist{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  #documentos .pdd-required-checklist .pdd-required-doc{
    width:100%!important;
    min-width:0!important;
    padding:11px!important;
    grid-template-columns:34px minmax(0,1fr)!important;
    gap:9px!important;
    border-radius:11px!important;
    background:#fff!important;
  }
  #documentos .pdd-required-doc-summary-copy{
    min-width:0!important;
  }
  #documentos .pdd-required-doc-summary-copy strong{
    color:var(--hdi514-ink)!important;
    overflow-wrap:anywhere!important;
  }
  #documentos .pdd-required-doc-summary-copy small{
    color:#728078!important;
    line-height:1.3!important;
    overflow-wrap:anywhere!important;
  }
  #documentos .pdd-required-doc-state{
    grid-column:2!important;
    justify-self:start!important;
    margin-top:3px!important;
    max-width:100%!important;
  }

  #documentos .pdd-upload-form{
    padding:13px!important;
    border:1px solid #cfe4d6!important;
    border-radius:13px!important;
    background:#fff!important;
  }
  #documentos .pdd-document-type{
    width:100%!important;
  }
  #documentos .pdd-document-type select{
    width:100%!important;
    min-height:46px!important;
    font-size:.82rem!important;
  }
  #documentos .pdd-dropzone{
    min-height:150px!important;
    padding:18px 12px!important;
    text-align:center!important;
    border-color:#b9dac5!important;
    background:#f7fbf8!important;
  }
  #documentos .pdd-dropzone strong,
  #documentos .pdd-dropzone span,
  #documentos .pdd-dropzone small{
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  #documentos .pdd-form-actions{
    width:100%!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  #documentos .pdd-form-actions .pdd-primary-button{
    width:100%!important;
    min-height:46px!important;
    background:var(--hdi514-green)!important;
    color:#fff!important;
  }

  #documentos .pdd-documents-heading{
    padding:14px 2px 8px!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  #documentos .pdd-documents-heading h3{
    color:var(--hdi514-ink)!important;
  }
  #documentos #refreshPortal{
    width:100%!important;
  }

  #documentos .pdd-documents-list{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  #documentos .pdd-document-row{
    width:100%!important;
    min-width:0!important;
    padding:11px!important;
    display:grid!important;
    grid-template-columns:36px minmax(0,1fr)!important;
    gap:8px!important;
    border:1px solid #dce9e0!important;
    border-radius:11px!important;
    background:#fff!important;
  }
  #documentos .pdd-document-copy{
    min-width:0!important;
  }
  #documentos .pdd-document-copy strong{
    overflow-wrap:anywhere!important;
  }
  #documentos .pdd-document-status,
  #documentos .pdd-document-actions{
    grid-column:2!important;
    justify-self:start!important;
  }
  #documentos .pdd-document-actions{
    width:100%!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:7px!important;
  }
  #documentos .pdd-document-actions a{
    width:100%!important;
    min-height:40px!important;
    justify-content:center!important;
  }

  /* Si todavía quedara una capa documental vieja, jamás permitimos dos columnas. */
  #documentos .hdi-v58-formatos,
  #documentos .hdi-v57-formatos-oficiales,
  #documentos .hdi-v3-formatos,
  #documentos #pt_v624_formatos_panel{
    width:100%!important;
    max-width:100%!important;
    grid-column:1/-1!important;
  }
  #documentos .hdi-v58-formatos__grid,
  #documentos .hdi-v513-formats-list{
    grid-template-columns:1fr!important;
  }

  /* Botón de formatos V5.13 dentro de carga */
  #documentos .hdi-v513-format-button{
    width:100%!important;
    min-height:48px!important;
    background:var(--hdi514-green)!important;
    color:#fff!important;
  }

  .hdi-v513-formats-modal.is-open{
    align-items:flex-end!important;
  }
  .hdi-v513-formats-dialog{
    width:100vw!important;
    max-width:100vw!important;
    max-height:86dvh!important;
    border-radius:18px 18px 0 0!important;
  }
  .hdi-v513-format-row{
    grid-template-columns:1fr!important;
  }
  .hdi-v513-format-row-actions{
    width:100%!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
  }
}

@media(max-width:390px){
  .pt-v627-mobile-case-data{
    grid-template-columns:1fr!important;
  }
  .pt-v627-mobile-action{
    padding-left:66px!important;
  }
  #documentos .pdd-portal-modal-card{
    padding-left:9px!important;
    padding-right:9px!important;
  }
}
