/* ═══════════════════════════════════════════════
   ALMA PROYECTOS — ESTILOS GLOBALES
   ═══════════════════════════════════════════════ */
:root {
    --verde-alma:      #94b4a1;
    --verde-oscuro:    #1b5e20;
    --naranja:         #d35400;
    --azul-btn:        #81bce9;
    --azul-cat:        #1a5276;
    --oscuro:          #2c3e50;
    --blanco:          #ffffff;
    --gris-fondo:      #f4f7f6;
    --gris-borde:      #dce3e0;
    --tab-activo:      #ffffff;
    --rojo-alerta:     #c0392b;
    --amarillo:        #f39c12;
    --verde-ok:        #27ae60;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Montserrat', sans-serif; background: var(--gris-fondo); color: #333; line-height: 1.6; }

/* ── Navbar ── */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 5%; background: var(--blanco);
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    position: sticky; top: 0; z-index: 1000;
}
.logo img { height: 60px; width: auto; display: block; }
.nav-links { list-style: none; display: flex; align-items: center; gap: 20px; }
.nav-links a { text-decoration: none; color: var(--oscuro); font-weight: 600; transition: color .2s; }
.nav-links a:hover { color: var(--verde-alma); }
.btn-nav { padding: 8px 18px; border-radius: 20px; color: var(--blanco) !important; font-size: .85rem; }
.btn-cliente  { background: var(--naranja); }
.btn-intranet { background: var(--oscuro); }

/* ── Home ── */
.hero {
    height: 420px; background: linear-gradient(135deg, var(--verde-alma) 0%, #6a9e88 100%);
    display: flex; align-items: center; justify-content: center; text-align: center; color: white;
}
.hero h1 { font-size: 3rem; margin-bottom: 10px; }
.hero p  { font-size: 1.2rem; opacity: .9; }
.container { padding: 60px 10%; width: 100%; max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 2rem; border-bottom: 3px solid var(--verde-alma); display: inline-block; padding-bottom: 5px; }
.bg-light { background: #eaf1ee; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card { background: white; padding: 30px; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.feature-card h3 { color: var(--verde-oscuro); margin-bottom: 10px; }
.services-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.service-item { background: white; padding: 20px 25px; border-left: 5px solid var(--verde-alma); border-radius: 6px; box-shadow: 0 1px 6px rgba(0,0,0,0.07); }

/* ══════════════════════════════════════════════
   PORTAL CLIENTES — REDISEÑO
══════════════════════════════════════════════ */

/* Selector de sección (reemplaza tabs naranjas) */
.portal-selector {
    display: flex; background: white;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.portal-selector .ps-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 20px 16px; cursor: pointer; font-weight: 700; font-size: .95rem;
    color: #888; border-bottom: 3px solid transparent; transition: all .2s;
    background: none; border-top: none; border-left: none; border-right: none;
    font-family: 'Montserrat', sans-serif;
}
.portal-selector .ps-btn:hover  { color: var(--oscuro); background: #f8f9fa; }
.portal-selector .ps-btn.active { color: var(--verde-oscuro); border-bottom-color: var(--verde-alma); background: #f0f7f4; }
.portal-selector .ps-btn .ps-icon { font-size: 1.4rem; }

/* Contenedor general del portal */
.portal-body { background: #f4f7f6; min-height: 520px; }

/* Panel de cada sección */
.portal-panel { display: none; }
.portal-panel.active { display: block; }

/* ── Panel Consulta ── */
.consulta-wrap {
    max-width: 620px; margin: 0 auto; padding: 52px 24px;
}
.consulta-card {
    background: white; border-radius: 16px; padding: 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.consulta-card h2 { font-size: 1.4rem; color: var(--oscuro); margin-bottom: 8px; }
.consulta-card p  { color: #777; font-size: .92rem; margin-bottom: 28px; }

/* ── Panel Contratar — fondo suave con pasos ── */
.contratar-wrap { max-width: 860px; margin: 0 auto; padding: 48px 24px; }

/* Indicador de pasos (stepper) */
.stepper {
    display: flex; align-items: center; margin-bottom: 36px; gap: 0;
}
.stepper-step {
    display: flex; flex-direction: column; align-items: center; flex: 1; position: relative;
}
.stepper-step::before {
    content: ''; position: absolute; top: 16px; right: -50%; width: 100%;
    height: 2px; background: #ddd; z-index: 0;
}
.stepper-step:last-child::before { display: none; }
.stepper-dot {
    width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: .85rem; z-index: 1;
    border: 2px solid #ddd; background: white; color: #aaa; transition: .3s;
}
.stepper-step.done   .stepper-dot { background: var(--verde-ok); border-color: var(--verde-ok); color: white; }
.stepper-step.active .stepper-dot { background: var(--verde-oscuro); border-color: var(--verde-oscuro); color: white; }
.stepper-step.active::before,
.stepper-step.done::before        { background: var(--verde-alma); }
.stepper-label { font-size: .72rem; color: #999; margin-top: 6px; text-align: center; font-weight: 600; }
.stepper-step.active .stepper-label { color: var(--verde-oscuro); }
.stepper-step.done   .stepper-label { color: var(--verde-ok); }

/* Tarjeta de cada paso */
.paso-card {
    background: white; border-radius: 16px; padding: 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08); display: none;
}
.paso-card.active { display: block; }
.paso-card h3 { font-size: 1.2rem; color: var(--oscuro); margin-bottom: 6px; }
.paso-card .paso-sub { color: #888; font-size: .9rem; margin-bottom: 28px; }

/* Inputs dentro del portal (fondo blanco heredado) */
.paso-card .input-captura { background: #f9fafb; border-color: #ddd; color: #333; }
.paso-card .input-captura:focus { background: white; border-color: var(--verde-alma); }

/* Acciones del paso */
.paso-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid #f0f0f0; }

/* Servicios en catálogo — nuevo diseño tarjetas */
.servicios-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; margin-bottom: 24px; }
.srv-card {
    border: 2px solid #e8e8e8; border-radius: 12px; padding: 20px; cursor: pointer;
    transition: all .2s; background: white; text-align: left; position: relative;
    overflow: hidden;
}
.srv-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: var(--gris-borde); transition: .2s;
}
.srv-card:hover  { border-color: var(--verde-alma); box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.srv-card:hover::before { background: var(--verde-alma); }
.srv-card.selected { border-color: var(--verde-oscuro); box-shadow: 0 4px 20px rgba(27,94,32,.2); }
.srv-card.selected::before { background: var(--verde-oscuro); }
.srv-card.disabled { opacity: .45; cursor: not-allowed; }
.srv-card .srv-icon { font-size: 1.8rem; margin-bottom: 10px; }
.srv-card h4 { font-size: .9rem; color: var(--oscuro); margin-bottom: 6px; line-height: 1.3; }
.srv-card p  { font-size: .8rem; color: #777; line-height: 1.5; }
.srv-card .srv-badge { position: absolute; top: 12px; right: 12px; font-size: .68rem; background: #f0f0f0; color: #999; padding: 2px 8px; border-radius: 20px; font-weight: 700; }
.srv-card.selected .srv-check { display: flex; }
.srv-check { display: none; position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; background: var(--verde-oscuro); border-radius: 50%; align-items: center; justify-content: center; color: white; font-size: .8rem; }

/* Confirmación final */
.confirm-card {
    background: linear-gradient(135deg, #e8f5e9 0%, #f0f7f4 100%);
    border: 2px solid #a5d6a7; border-radius: 16px; padding: 48px 40px; text-align: center;
}
.confirm-icon { font-size: 4rem; margin-bottom: 20px; }
.confirm-folio {
    background: white; border-radius: 10px; padding: 20px 32px; display: inline-block;
    margin: 20px 0; box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.confirm-folio .folio-num { font-size: 2rem; font-weight: 700; color: var(--verde-oscuro); }

/* Panel consulta — resultado */
.resultado-carpeta {
    margin-top: 20px; border-radius: 12px; overflow: hidden;
    border: 1px solid #e0e0e0; background: white;
}
.res-header { background: var(--oscuro); color: white; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
.res-body { padding: 20px; }
.timeline-item { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--verde-alma); margin-top: 5px; flex-shrink: 0; }
.timeline-fecha { font-size: .78rem; color: #aaa; }

/* ── Mantener compatibilidad con panel-contratar viejo ── */
.panel-consulta  { display: none; }
.panel-contratar { display: none; }

/* ── Catálogo ── */
#paso-catalogo {
    position: relative; width: 100%; min-height: 550px; padding: 40px 10%;
    display: flex; flex-direction: column;
    background-size: cover; background-position: center; transition: background-image .4s;
}
#paso-catalogo::before {
    content: ""; position: absolute; inset: 0;
    background: rgba(0,0,0,.65); z-index: 1;
}
.catalogo-layout { position: relative; z-index: 2; display: flex; gap: 40px; align-items: flex-start; }
.caja-azul-alma { background: var(--azul-cat); padding: 28px; border: 2px solid white; flex: 1; border-radius: 8px; }
.caja-azul-alma h3 { color: white; margin-bottom: 16px; font-size: .95rem; letter-spacing: 1px; }
.item-servicio {
    display: flex; align-items: center; background: rgba(255,255,255,.1);
    padding: 14px 16px; margin-bottom: 10px; border-radius: 6px; cursor: pointer; transition: .2s;
    color: white;
}
.item-servicio:hover { background: rgba(255,255,255,.25); transform: translateX(6px); }
.item-servicio.selected { background: var(--azul-btn); color: var(--oscuro); font-weight: bold; }
.info-lateral { flex: 1; }
.info-card { background: rgba(255,255,255,.95); padding: 36px; border-radius: 12px; }
.info-card h3 { color: var(--verde-oscuro); margin-bottom: 12px; }
#info-texto { font-size: 1.1rem; line-height: 1.7; color: #222; }

/* ── Formularios ── */
.form-group { display: flex; align-items: center; margin-bottom: 18px; }
.form-group label { width: 200px; font-weight: 600; flex-shrink: 0; }
.input-captura {
    background: white; border: 2px solid #bbb; border-radius: 8px;
    padding: 11px 14px; width: 100%; max-width: 380px; color: #333; font-size: .95rem;
    transition: border-color .2s;
}
.input-captura:focus { outline: none; border-color: var(--azul-btn); }
.input-captura[readonly] { background: #f0f0f0; cursor: default; }
select.input-captura { cursor: pointer; }
.btn-captura {
    background: var(--azul-btn); color: var(--oscuro); border: 1px solid #5a9bd4;
    border-radius: 10px; padding: 12px 36px; font-weight: 700; cursor: pointer;
    font-family: 'Montserrat', sans-serif; transition: background .2s;
}
.btn-captura:hover { background: #5aabdf; }
.btn-captura.verde { background: var(--verde-ok); color: white; border-color: #1e9e55; }
.btn-captura.verde:hover { background: #1e9e55; }
.btn-captura.rojo { background: var(--rojo-alerta); color: white; border-color: #a93226; }
.f-col { display: flex; flex-direction: column; gap: 5px; }
.f-col label { font-size: .88rem; font-weight: 600; }

/* ── Upload Documentos ── */
.docs-grid { display: grid; gap: 16px; margin-top: 20px; }
.doc-row {
    background: white; border-radius: 10px; padding: 18px 22px;
    display: flex; align-items: center; gap: 16px; box-shadow: 0 1px 6px rgba(0,0,0,.07);
    border-left: 5px solid var(--gris-borde);
}
.doc-row.pendiente  { border-left-color: var(--amarillo); }
.doc-row.aprobado   { border-left-color: var(--verde-ok); }
.doc-row.observado  { border-left-color: var(--rojo-alerta); }
.doc-row .doc-nombre { flex: 1; font-weight: 600; }
.doc-row .doc-estado { font-size: .85rem; padding: 3px 10px; border-radius: 20px; font-weight: 700; }
.estado-pendiente { background: #fff3cd; color: #856404; }
.estado-aprobado  { background: #d4edda; color: #155724; }
.estado-observado { background: #f8d7da; color: #721c24; }
.doc-obs { font-size: .85rem; color: var(--rojo-alerta); margin-top: 4px; font-style: italic; }

/* ── Alertas ── */
.alerta { padding: 14px 18px; border-radius: 8px; margin: 10px 0; font-weight: 600; }
.alerta-ok      { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alerta-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alerta-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alerta-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ── Intranet Layout ── */
.intra-layout { display: flex; min-height: calc(100vh - 80px); }
.intra-sidebar {
    width: 250px; background: var(--oscuro); color: white; flex-shrink: 0;
    padding: 24px 0; display: flex; flex-direction: column;
}
.sidebar-user { padding: 16px 24px; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 16px; }
.sidebar-user .nombre { font-weight: 700; font-size: 1rem; }
.sidebar-user .rol    { font-size: .78rem; opacity: .7; text-transform: uppercase; letter-spacing: 1px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px; padding: 12px 24px;
    color: rgba(255,255,255,.8); text-decoration: none; transition: .2s; font-weight: 500;
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,.12); color: white; }
.sidebar-nav .sep { height: 1px; background: rgba(255,255,255,.1); margin: 8px 0; }
.intra-main { flex: 1; padding: 32px 36px; overflow-y: auto; }
.intra-title { font-size: 1.6rem; font-weight: 700; color: var(--oscuro); margin-bottom: 24px; }

/* ── Tabs intranet ── */
.tabs-bar { display: flex; border-bottom: 3px solid var(--verde-alma); margin-bottom: 28px; gap: 4px; }
.tabs-bar .tab {
    padding: 10px 22px; cursor: pointer; border-radius: 6px 6px 0 0;
    font-weight: 600; font-size: .92rem; color: #666; background: #e8eceb; transition: .2s;
}
.tabs-bar .tab.active { background: var(--verde-alma); color: white; }
.tabs-bar .tab:hover:not(.active) { background: #d0dbd5; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Carpeta badge ── */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: .78rem; font-weight: 700;
}
.badge-revision   { background: #fff3cd; color: #856404; }
.badge-cobro      { background: #cce5ff; color: #004085; }
.badge-pago       { background: #d4edda; color: #155724; }
.badge-ing        { background: #d1ecf1; color: #0c5460; }
.badge-sag        { background: #e2d9f3; color: #4a235a; }
.badge-finalizado { background: #d4edda; color: #0b5e24; }
.badge-sin-asignar{ background: #f8d7da; color: #721c24; }

/* ── Tablas ── */
.tabla-alma { width: 100%; border-collapse: collapse; background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 8px rgba(0,0,0,.07); }
.tabla-alma thead { background: var(--oscuro); color: white; }
.tabla-alma th, .tabla-alma td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--gris-borde); }
.tabla-alma tbody tr:hover { background: #f0f5f3; }
.tabla-alma .acciones { display: flex; gap: 8px; }

/* ── Mini Cards dashboard ── */
.cards-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-bottom: 30px; }
.mini-card {
    background: white; border-radius: 12px; padding: 22px; text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.08); border-top: 4px solid var(--verde-alma);
}
.mini-card .valor { font-size: 2.2rem; font-weight: 700; color: var(--oscuro); }
.mini-card .etiq  { font-size: .82rem; color: #777; margin-top: 4px; }

/* ── Detalle carpeta ── */
.detalle-header {
    background: white; border-radius: 12px; padding: 24px 28px; margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07); display: flex; justify-content: space-between; align-items: flex-start;
}
.detalle-header .folio { font-size: 1.4rem; font-weight: 700; color: var(--oscuro); }
.paso-timeline {
    display: flex; gap: 0; margin-bottom: 24px; border-radius: 10px; overflow: hidden;
}
.paso-step {
    flex: 1; padding: 12px 8px; text-align: center; font-size: .78rem; font-weight: 600;
    background: #e8eceb; color: #888; border-right: 2px solid white; position: relative;
}
.paso-step:last-child { border-right: none; }
.paso-step.completado { background: var(--verde-alma); color: white; }
.paso-step.activo     { background: var(--azul-btn); color: white; }
.paso-step .num       { display: block; font-size: 1.2rem; font-weight: 700; }

/* ── Botón pequeño ── */
.btn-sm {
    padding: 6px 14px; border-radius: 6px; font-size: .82rem; font-weight: 600;
    cursor: pointer; border: none; font-family: 'Montserrat', sans-serif; transition: .2s;
}
.btn-sm.azul   { background: var(--azul-btn); color: var(--oscuro); }
.btn-sm.verde  { background: var(--verde-ok); color: white; }
.btn-sm.rojo   { background: var(--rojo-alerta); color: white; }
.btn-sm.gris   { background: #aaa; color: white; }
.btn-sm.oscuro { background: var(--oscuro); color: white; }
.btn-sm:hover  { opacity: .85; }

/* ── Footer ── */
footer { background: var(--oscuro); color: rgba(255,255,255,.7); text-align: center; padding: 20px; font-size: .85rem; }

/* ══════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 900px)
══════════════════════════════════════════════ */
@media (max-width: 900px) {
    .features-grid, .services-list  { grid-template-columns: 1fr 1fr; }
    .cards-row                       { grid-template-columns: 1fr 1fr; }
    .catalogo-layout                 { flex-direction: column; }
    .intra-sidebar                   { width: 200px; }
    .container                       { padding: 40px 5%; }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 600px)
══════════════════════════════════════════════ */
@media (max-width: 600px) {

    /* Layout general */
    .features-grid, .services-list  { grid-template-columns: 1fr; }
    .cards-row                       { grid-template-columns: 1fr 1fr; }
    .intra-layout                    { flex-direction: column; }
    .intra-sidebar                   { width: 100%; }
    .hero h1                         { font-size: 2rem; }
    .container                       { padding: 30px 4%; }

    /* Navbar mobile */
    .navbar                          { padding: 8px 4%; flex-wrap: wrap; gap: 8px; }
    .nav-links                       { gap: 10px; flex-wrap: wrap; }
    .nav-links li:last-child         { display: none; } /* ocultar botón intranet en mobile público */

    /* Portal tabs */
    .sistema-tabs .tab-item          { font-size: .82rem; padding: 14px 8px; }

    /* Paneles del portal cliente */
    .panel-consulta,
    #sec-consulta > div              { padding: 28px 5% !important; }

    #paso-1                          { padding: 36px 5% !important; }
    #paso-registro                   { padding: 24px 5% !important; }
    #paso-documentos                 { padding: 28px 5% !important; }
    #paso-confirmacion               { padding: 36px 5% !important; }
    #paso-catalogo                   { padding: 24px 4% !important; }

    /* form-group: apila label arriba del input en mobile */
    .form-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 16px;
    }
    .form-group label                { width: 100%; font-size: .9rem; }
    .form-group .input-captura       { max-width: 100%; width: 100%; }
    .form-group .btn-captura         { margin-left: 0 !important; margin-top: 8px; width: 100%; }

    /* input-captura full width mobile */
    .input-captura                   { max-width: 100% !important; width: 100%; font-size: 16px; /* evita zoom iOS */ }

    /* btn-captura full width en pasos de cliente */
    .panel-contratar .btn-captura,
    .panel-consulta  .btn-captura    { width: 100%; text-align: center; }

    /* Registro nuevo cliente — grid de 1 columna */
    #paso-registro form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Catálogo mobile */
    .catalogo-layout                 { flex-direction: column; gap: 20px; }
    .caja-azul-alma                  { padding: 18px; }
    .item-servicio                   { padding: 12px; font-size: .88rem; }
    .info-card                       { padding: 20px; }
    #info-texto                      { font-size: .95rem; }

    /* Docs grid mobile */
    .doc-row                         { flex-direction: column; align-items: flex-start; gap: 12px; }
    .doc-row > div:last-child        { width: 100%; }

    /* Confirmación mobile */
    #paso-confirmacion > div         { padding: 24px 16px !important; }

    /* Intranet mobile */
    .intra-main                      { padding: 20px 16px; }
    .intra-title                     { font-size: 1.2rem; }
    .tabs-bar                        { flex-wrap: wrap; }
    .tabs-bar .tab                   { flex: none; font-size: .78rem; padding: 8px 12px; }
    .tabla-alma                      { font-size: .82rem; }
    .tabla-alma th, .tabla-alma td   { padding: 9px 8px; }
    .cards-row                       { grid-template-columns: 1fr 1fr; gap: 10px; }
    .mini-card                       { padding: 16px 12px; }
    .mini-card .valor                { font-size: 1.6rem; }
    .detalle-header                  { flex-direction: column; gap: 16px; }
    .paso-timeline                   { flex-wrap: wrap; }
    .paso-step                       { flex: none; width: calc(33% - 4px); font-size: .7rem; padding: 8px 4px; }
}

/* Evitar zoom en inputs iOS (font-size mínimo 16px) */
@media (max-width: 480px) {
    input, select, textarea { font-size: 16px !important; }
}

