/* PERFIL-CONCEPTO3-A13 */

.c3-icon{
  width:22px;height:22px;fill:none;stroke:currentColor;
  stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;
  flex:0 0 auto
}

body.c3-editor-open{overflow:hidden}

body.c3-ready main{
  max-width:980px;
  padding-bottom:24px
}

body.c3-ready .hero-panel,
body.c3-ready .layout{
  display:none!important
}

.c3-dashboard{
  display:grid;
  gap:16px
}

.c3-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:8px 2px 0
}

.c3-heading h1{
  margin:4px 0 5px;
  color:var(--azul-oscuro);
  font-size:clamp(28px,5vw,38px);
  line-height:1.08
}

.c3-heading p{
  margin:0;
  color:var(--muted);
  font-size:15px
}

.c3-eyebrow{
  color:var(--azul);
  font-weight:800;
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.05em
}

.c3-icon-button{
  width:44px;height:44px;
  display:grid;place-items:center;
  border:1px solid var(--borde);
  border-radius:14px;
  background:#fff;
  color:var(--azul);
  box-shadow:0 8px 20px rgba(11,43,91,.08)
}

.c3-profile-card,
.c3-section,
.c3-details,
.c3-pending{
  background:#fff;
  border:1px solid var(--borde);
  border-radius:22px;
  box-shadow:var(--sombra)
}

.c3-profile-card{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:16px;
  align-items:center;
  padding:20px
}

.c3-avatar{
  width:76px;height:76px;
  display:grid;place-items:center;
  border-radius:24px;
  background:linear-gradient(145deg,var(--azul),var(--azul-oscuro));
  color:#fff;
  font-weight:900;
  font-size:28px
}

.c3-profile-copy{min-width:0}

.c3-profile-copy h2{
  margin:0 0 4px;
  color:var(--azul-oscuro);
  font-size:24px
}

.c3-profile-copy p{
  margin:0 0 10px;
  color:var(--muted);
  overflow-wrap:anywhere
}

.c3-badge,
.c3-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  font-weight:800
}

.c3-badge{
  padding:8px 11px;
  font-size:12px
}

.c3-badge-ok{
  color:#137a2a;
  background:#eaf9ee;
  border:1px solid #c9efd2
}

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

.c3-mini-facts>div{
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
  padding:13px 14px;
  background:#fff;
  border:1px solid var(--borde);
  border-radius:17px
}

.c3-mini-facts .c3-icon{color:var(--azul)}

.c3-mini-facts span{
  min-width:0;
  display:flex;
  flex-direction:column
}

.c3-mini-facts small{
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  text-transform:uppercase
}

.c3-mini-facts b{
  color:var(--texto);
  font-size:13px;
  overflow-wrap:anywhere
}

.c3-info{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:15px 16px;
  border:1px solid #bad7fb;
  border-radius:18px;
  background:#eef6ff;
  color:#31567f
}

.c3-info span{color:var(--azul)}

.c3-info p{
  margin:0;
  font-size:14px;
  line-height:1.45
}

.c3-section{overflow:hidden}

.c3-section-head{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:17px 18px 14px
}

.c3-section-icon{
  width:44px;height:44px;
  display:grid;place-items:center;
  border-radius:14px;
  color:var(--azul);
  background:#eaf3ff
}

.c3-section-head h3{
  margin:0 0 3px;
  color:var(--azul-oscuro);
  font-size:18px
}

.c3-section-head p{
  margin:0;
  color:var(--muted);
  font-size:13px
}

.c3-chip{
  padding:7px 10px;
  font-size:11px;
  white-space:nowrap
}

.c3-chip-green{
  color:#137a2a;
  background:#eaf9ee
}

.c3-chip-amber{
  color:#9a5a00;
  background:#fff2cf
}

.c3-section-green .c3-section-icon{
  background:#e9faef;
  color:#159447
}

.c3-section-amber .c3-section-icon{
  background:#fff5de;
  color:#c97800
}

.c3-rows{
  border-top:1px solid #edf1f6
}

.c3-row{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:12px;
  align-items:center;
  padding:13px 18px;
  border-bottom:1px solid #edf1f6
}

.c3-row:last-child{border-bottom:0}

.c3-row-icon{color:#41648f}

.c3-row-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px
}

.c3-row-copy strong{
  color:var(--texto);
  font-size:14px
}

.c3-row-copy small{
  color:var(--muted);
  font-size:13px;
  overflow-wrap:anywhere
}

.c3-pending{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:15px 16px
}

.c3-pending.is-clear{
  background:#f2f8ff;
  border-color:#cde0f9
}

.c3-pending.is-pending{
  background:#fff8e8;
  border-color:#f5d27e
}

.c3-pending-icon{
  width:42px;height:42px;
  display:grid;place-items:center;
  border-radius:50%;
  color:var(--azul);
  background:#e7f1ff
}

.c3-pending.is-pending .c3-pending-icon{
  color:#a85f00;
  background:#fff0c6
}

.c3-pending>div{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px
}

.c3-pending strong{
  color:var(--azul-oscuro);
  font-size:14px
}

.c3-pending small{
  color:var(--muted);
  font-size:12px
}

.c3-link-button{
  border:0;
  background:transparent;
  color:var(--azul);
  font:inherit;
  font-weight:800;
  cursor:pointer;
  padding:8px
}

.c3-pending-detail{
  padding:14px;
  border:1px solid #f5d27e;
  border-radius:18px;
  background:#fffdf7
}

.c3-details{overflow:hidden}

.c3-details>summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:17px 18px;
  color:var(--azul-oscuro);
  font-weight:800
}

.c3-details>summary::-webkit-details-marker{display:none}

.c3-details>summary span{
  display:flex;
  align-items:center;
  gap:10px
}

.c3-details[open]>summary>.c3-icon{
  transform:rotate(90deg)
}

#c3TechnicalSlot{
  padding:0 16px 10px
}

#c3TechnicalSlot .info-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))
}

.c3-raw-toggle{
  margin:0 10px 12px
}

.c3-raw-box{
  margin:0 16px 16px;
  padding:12px;
  max-height:260px;
  overflow:auto;
  border-radius:12px;
  background:#0f172a;
  color:#dbeafe;
  font-size:11px;
  white-space:pre-wrap
}

.c3-quick-section{
  padding-bottom:16px
}

.c3-quick-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  padding:0 16px
}

.c3-quick-grid a{
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:92px;
  border:1px solid var(--borde);
  border-radius:16px;
  background:#f8fbff;
  color:var(--azul-oscuro);
  text-decoration:none;
  text-align:center
}

.c3-quick-grid span{font-size:25px}
.c3-quick-grid b{font-size:12px}

.c3-page-actions{
  position:sticky;
  bottom:0;
  z-index:20;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);
  gap:10px;
  padding:10px;
  border:1px solid var(--borde);
  border-radius:18px;
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(12px);
  box-shadow:0 -8px 30px rgba(11,43,91,.12)
}

.c3-btn{
  min-height:50px;
  border-radius:14px;
  border:1px solid transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font:inherit;
  font-weight:900;
  cursor:pointer
}

.c3-btn-primary{
  color:#fff;
  background:linear-gradient(135deg,#0b6edb,var(--azul))
}

.c3-btn-secondary{
  color:var(--azul);
  border-color:#b8d4f5;
  background:#f4f9ff
}

.c3-logout{
  justify-self:center;
  border:0;
  background:transparent;
  color:#b42318;
  font:inherit;
  font-weight:800;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 12px 14px;
  cursor:pointer
}

/* EDITOR GUIADO */

.c3-editor-backdrop{
  position:fixed;
  inset:0;
  z-index:2000;
  opacity:0;
  background:rgba(15,23,42,.48);
  transition:opacity .18s ease
}

.c3-editor-backdrop.is-open{opacity:1}

.c3-editor-sheet{
  position:fixed;
  z-index:2001;
  left:50%;
  bottom:0;
  width:min(760px,100%);
  max-height:92dvh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid #dbe6f2;
  border-radius:28px 28px 0 0;
  background:#fff;
  box-shadow:0 -24px 80px rgba(7,55,111,.26);
  transform:translate(-50%,105%);
  transition:transform .2s ease
}

.c3-editor-sheet.is-open{
  transform:translate(-50%,0)
}

.c3-editor-head{
  position:relative;
  padding:18px 58px 10px 22px
}

.c3-sheet-grabber{
  display:block;
  width:48px;
  height:5px;
  margin:0 auto 14px;
  border-radius:999px;
  background:#94a3b8
}

.c3-editor-head h2{
  margin:0 0 5px;
  color:var(--azul-oscuro);
  font-size:23px
}

.c3-editor-head p{
  margin:0;
  color:var(--muted);
  font-size:13px
}

.c3-close{
  position:absolute;
  right:16px;
  top:18px;
  width:38px;
  height:38px;
  border:0;
  border-radius:50%;
  background:#f1f5f9;
  color:#51657f;
  font-size:27px;
  cursor:pointer
}

.c3-stepper{
  display:grid;
  grid-template-columns:auto 1fr auto 1fr auto;
  align-items:start;
  gap:8px;
  padding:8px 22px 14px
}

.c3-stepper>i{
  height:2px;
  margin-top:17px;
  background:#dce6f2
}

.c3-step{
  min-width:72px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  color:#8a98ab;
  text-align:center
}

.c3-step b{
  width:34px;height:34px;
  display:grid;place-items:center;
  border-radius:50%;
  background:#edf2f7;
  color:#64748b
}

.c3-step small{
  font-size:11px;
  font-weight:800
}

.c3-step.is-active{color:var(--azul)}

.c3-step.is-active b{
  color:#fff;
  background:var(--azul)
}

.c3-step.is-done b{
  color:#fff;
  background:var(--verde)
}

.c3-editor-scroll{
  min-height:0;
  overflow:auto;
  padding:0 18px max(18px,env(safe-area-inset-bottom))
}

.c3-editor-scroll #formEditarPerfil{
  display:block;
  margin:0
}

.c3-editor-scroll .edit-panel{
  border:0;
  padding:0;
  background:transparent
}

.c3-editor-scroll .form-section{
  margin:0;
  border:1px solid var(--borde);
  border-radius:18px;
  background:#fff
}

.c3-editor-scroll .form-actions{
  position:sticky;
  bottom:0;
  z-index:3;
  margin-top:12px;
  padding:12px 0 2px;
  background:#fff
}

.c3-wizard-nav{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:14px
}

.c3-confirm{
  display:grid;
  gap:12px;
  padding:4px 0
}

.c3-confirm section{
  overflow:hidden;
  border:1px solid var(--borde);
  border-radius:16px
}

.c3-confirm h4{
  margin:0;
  padding:12px 14px;
  color:var(--azul-oscuro);
  background:#f4f8fd
}

.c3-confirm-row{
  display:grid;
  grid-template-columns:130px minmax(0,1fr) auto minmax(0,1fr);
  gap:8px;
  align-items:center;
  padding:10px 12px;
  border-top:1px solid #edf1f6;
  font-size:12px
}

.c3-confirm-row strong{color:#536985}

.c3-confirm-row span{
  min-width:0;
  overflow-wrap:anywhere
}

.c3-confirm-row b{color:var(--azul)}

.c3-confirm-note,
.c3-empty{
  padding:13px 14px;
  border-radius:14px;
  background:#eef6ff;
  color:#31567f;
  font-size:13px
}

@media(min-width:761px){
  .c3-dashboard{
    grid-template-columns:repeat(2,minmax(0,1fr))
  }

  .c3-heading,
  .c3-profile-card,
  .c3-mini-facts,
  .c3-info,
  .c3-pending,
  .c3-pending-detail,
  .c3-details,
  .c3-page-actions,
  .c3-logout{
    grid-column:1/-1
  }
}

@media(max-width:700px){
  body.c3-ready main{
    padding:18px 14px 24px
  }

  .c3-dashboard{gap:12px}

  .c3-heading h1{font-size:27px}

  .c3-profile-card{padding:16px}

  .c3-avatar{
    width:64px;height:64px;
    border-radius:20px;
    font-size:24px
  }

  .c3-profile-copy h2{font-size:20px}

  .c3-mini-facts{
    grid-template-columns:1fr
  }

  .c3-mini-facts>div{
    padding:11px 13px
  }

  .c3-section-head{
    grid-template-columns:auto minmax(0,1fr);
    padding:15px 14px 12px
  }

  .c3-section-head .c3-chip{
    grid-column:2;
    justify-self:start
  }

  .c3-row{padding:12px 14px}

  .c3-pending{
    grid-template-columns:auto minmax(0,1fr)
  }

  .c3-pending .c3-link-button{
    grid-column:2;
    justify-self:start;
    padding-left:0
  }

  #c3TechnicalSlot .info-grid{
    grid-template-columns:1fr
  }

  .c3-quick-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))
  }

  .c3-page-actions{
    margin-left:-4px;
    margin-right:-4px
  }

  .c3-editor-sheet{
    max-height:94dvh
  }

  .c3-stepper{
    padding-left:14px;
    padding-right:14px;
    gap:5px
  }

  .c3-step{min-width:66px}

  .c3-confirm-row{
    grid-template-columns:1fr;
    gap:4px
  }

  .c3-confirm-row b{
    transform:rotate(90deg);
    justify-self:start
  }
}

@media(max-width:390px){
  .c3-profile-card{
    grid-template-columns:1fr
  }

  .c3-avatar{
    width:56px;height:56px
  }

  .c3-page-actions{
    grid-template-columns:1fr
  }
}

/* ==============================================================
   PERFIL-CONCEPTO3-A13-A1-R1
   Corrección footer wizard + compactación móvil
   ============================================================== */

/*
 * Los estilos propios .c3-btn y .form-actions tienen display
 * explícito. Respetamos siempre el contrato semántico hidden.
 */
.c3-editor-sheet [hidden]{
  display:none!important;
}

/*
 * El formulario conserva sus acciones originales en el DOM,
 * pero Concepto 3 utiliza exclusivamente el footer guiado.
 */
.c3-editor-scroll .form-actions{
  display:none!important;
}

.c3-wizard-nav{
  position:sticky;
  bottom:0;
  z-index:6;
  margin-top:14px;
  padding:12px 0 max(8px,env(safe-area-inset-bottom));
  border-top:1px solid #edf1f6;
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(12px);
}

.c3-wizard-nav[data-step="1"] #c3Next{
  flex:1 1 100%;
}

.c3-wizard-nav[data-step="2"] #c3Prev,
.c3-wizard-nav[data-step="2"] #c3Next{
  flex:1 1 0;
}

.c3-wizard-nav[data-step="3"] #c3Prev{
  flex:0 0 36%;
}

.c3-wizard-nav[data-step="3"] #c3Next{
  flex:1 1 auto;
}

.c3-wizard-nav #c3Next.is-save{
  color:#fff;
  background:linear-gradient(
    135deg,
    #31a843,
    #208c32
  );
}

/*
 * La captura real mostró que 390px era demasiado agresivo
 * para apilar avatar y nombre. Los mantenemos lado a lado.
 */
@media(max-width:390px){
  .c3-profile-card{
    grid-template-columns:auto minmax(0,1fr);
    gap:12px;
    padding:15px;
  }

  .c3-avatar{
    width:58px;
    height:58px;
    border-radius:18px;
    font-size:22px;
  }

  .c3-profile-copy h2{
    font-size:18px;
  }

  .c3-profile-copy p{
    font-size:13px;
    margin-bottom:8px;
  }

  .c3-badge{
    padding:6px 9px;
    font-size:10px;
  }

  .c3-page-actions{
    grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);
  }
}

/*
 * En móvil: ubicación ocupa la primera fila y
 * vínculo + estado comparten la segunda.
 */
@media(max-width:700px){
  .c3-mini-facts{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:9px;
  }

  .c3-mini-facts>div{
    min-height:68px;
    padding:10px 11px;
    gap:8px;
  }

  .c3-mini-facts>div:first-child{
    grid-column:1/-1;
  }

  .c3-mini-facts .c3-icon{
    width:20px;
    height:20px;
  }

  .c3-mini-facts small{
    font-size:10px;
  }

  .c3-mini-facts b{
    font-size:12px;
  }
}

/* ==============================================================
   PERFIL-CONCEPTO3-A13-A1-R3
   Jerarquía final de acciones
   ============================================================== */

.c3-page-actions{
  grid-template-columns:minmax(0,.72fr) minmax(0,1.55fr);
}

#c3Actualizar{
  min-height:48px;
  color:#496781;
  border-color:#d5e1ed;
  background:#f7fafc;
  font-weight:800;
}

#c3Actualizar .c3-icon{
  width:19px;
  height:19px;
}

#c3Editar{
  min-height:52px;
  box-shadow:0 8px 22px rgba(11,110,219,.20);
}

@media(max-width:390px){
  .c3-page-actions{
    grid-template-columns:minmax(0,.72fr) minmax(0,1.55fr);
  }

  #c3Actualizar{
    font-size:13px;
    padding-left:8px;
    padding-right:8px;
  }

  #c3Editar{
    font-size:14px;
  }
}

/* ==============================================================
   PERFIL-CONCEPTO3-A13-A1-R4
   Confirmación deshabilitada cuando no existen cambios
   ============================================================== */

.c3-wizard-nav #c3Next:disabled{
  cursor:not-allowed;
  opacity:.52;
  box-shadow:none;
  filter:saturate(.45);
}

.c3-wizard-nav #c3Next:disabled:hover,
.c3-wizard-nav #c3Next:disabled:active{
  transform:none;
}
