/* css/platform.css */

/* Ajustes generales para el body de plataforma */
.platform-body {
    background-color: #f4f7f6;
    padding-top: 100px; /* Espacio para el nav fijo */
}

.platform-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 80vh;
}

/* AnimaciÃ³n de entrada */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Banner de Bienvenida */
.welcome-banner {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.2);
}
.welcome-banner h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); margin-bottom: 10px; }

/* Dashboard Grid */
.dashboard-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.dash-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.3s;
    width: 300px;
    text-align: center;
    border-left: 5px solid #28a745;
}
.dash-card:hover { transform: translateY(-5px); }

/* NOTICIAS GRID (Otras secciones) */
.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

/* ================================================================== */
/* CARNET CORDAMI — DISEÑO EXACTO A CAPTURAS (cn2-card)               */
/* ================================================================== */

/* Área contenedora */
.carnet-preview-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    overflow-x: auto;
    background: #f4f7f6; /* Fondo suave para que resalte la tarjeta */
}

/* Base de la Tarjeta */
.cn2-card, .cn2-card * {
    box-sizing: border-box;
}

.cn2-card {
    width: 600px; /* Dimensiones solicitadas para print exacto */
    height: 360px;
    background: #ffffff;
    border: 2px solid #bbc1bc;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    overflow: hidden;
    position: relative;
    font-family: 'Arial', sans-serif;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* ===================================== */
/* ANVERSO (CARA FRONTAL)                */
/* ===================================== */

.cn2-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 15px;
    background: #ffffff;
    height: 65px;
    width: 100%;
}
.cn2-header-img-center {
    width: 100%;
    height: 100%;
    max-height: 55px;
    object-fit: contain;
}
.cn2-title-bar {
    background: #194a2b; /* Verde oscuro institucional */
    color: #ffffff;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 8px 0;
    text-transform: uppercase;
}

.cn2-body {
    display: flex;
    padding: 12px 20px;
    align-items: center;
    flex: 1;
}

.cn2-photo-col {
    flex-shrink: 0;
}
.cn2-photo-frame {
    width: 105px;
    height: 135px;
    border: 2px solid #194a2b;
    border-radius: 8px;
    overflow: hidden;
    background: #e8e8e8;
}
.cn2-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cn2-data-col {
    width: 250px;
    padding-left: 15px;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.cn2-data-group {
    margin-bottom: 8px;
}
.cn2-field-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #000;
    margin: 0 0 2px 0;
}
.cn2-field-val {
    font-size: 0.85rem; /* Ligeramente reducido para mayor capacidad por línea */
    font-weight: 600; /* Un poco más de contraste para legibilidad */
    color: #333;
    margin: 0;
    text-transform: uppercase;
    line-height: 1.2;
    word-break: break-word; /* Evita que las palabras muy largas desborden, permitiendo salto natural */
    max-width: 100%;
}
.cn2-cedula-line {
    margin: 6px 0 0 0;
    font-size: 0.90rem;
    white-space: nowrap;
}

.cn2-qr-line-separator {
    width: 4px;
    background: #194a2b;
    height: 120px;
    margin-right: 40px;
}

.cn2-qr-col {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
#cn-qr-container {
    width: 115px;
    height: 115px;
}
#cn-qr-container img, #cn-qr-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.cn2-bottom-strip {
    background: #eaf3ea; /* Verde muy claro */
    display: flex;
    border-top: 1px solid #194a2b;
    border-bottom: 1px solid #194a2b;
    margin-top: 11px;
    height: 50px; /* Fijar alto para evitar desbordes */
}
.cn2-strip-item {
    flex: 1;
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid #194a2b;
    overflow: hidden;
}
.cn2-strip-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: #194a2b;
    text-transform: uppercase;
    margin-bottom: 2px;
    white-space: nowrap;
}
.cn2-strip-val {
    font-size: 0.8rem;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cn2-footer-bar {
    background: #194a2b;
    color: #ffffff;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 2px;
    padding: 6px;
    text-transform: uppercase;
}


/* ===================================== */
/* REVERSO (CARA TRASERA)                */
/* ===================================== */

.cn2-back-top {
    background: #194a2b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    height: auto;
}
.cn2-serial-box {
    background: #ffffff;
    border-radius: 5px;
    padding: 5px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.cn2-serial-word {
    font-size: 0.9rem;
    font-weight: 800;
    color: #000;
}
.cn2-serial-num {
    font-size: 1.1rem;
    font-weight: 900;
    color: #c91a1a; /* Rojo oscuro como en foto */
}
.cn2-back-institution {
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: right;
    max-width: 60%;
    line-height: 1.3;
}

.cn2-back-legal {
    padding: 10px 30px; /* Menos espacio arriba y abajo para no aplastar el centro */
    position: relative;
    z-index: 2; /* Texto por encima de la firma */
}
.cn2-back-legal em {
    font-size: 0.95rem;
    color: #444;
    font-style: italic;
    line-height: 1.4;
    display: block;
}

.cn2-back-middle {
    flex: 1; /* Ocupa todo el espacio restante */
    position: relative;
    padding: 0 35px;
    display: flex;
    align-items: center; /* Centrado vertical en el espacio intermedio */
}
.cn2-dates-block {
    display: flex;
    gap: 35px;
    position: relative;
    z-index: 2; /* Sobre la firma */
    margin-top: 10px;
}
.cn2-date-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cn2-date-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #000;
    line-height: 1.2;
}
.cn2-date-val {
    font-size: 0.95rem;
    font-weight: 800;
    color: #222;
}

.cn2-signature-block {
    position: absolute;
    bottom: -95px; /* Ligeramente por encima del footer */
    left: 50%;
    transform: translateX(-50%); /* Perfecto centrado horizontal */
    width: 320px; /* Mas amplio segun requerimiento */
    z-index: 0; /* Totalmente al fondo, bajo todo el texto */
    display: flex;
    justify-content: center;
}
.cn2-signature-img {
    width: 500px;
    max-height: 500px; /* Ligeramente más grande */
    object-fit: contain;
    mix-blend-mode: multiply; /* Importante para transparencias */
}

.cn2-footer-back {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 5;
}


/* ---- TOGGLE FRONTAL/REVERSO ---- */
.carnet-face-toggle {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    margin-top: 15px;
}
.face-toggle-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 24px;
    border-radius: 30px;
    border: 2px solid #194a2b;
    background: white;
    color: #194a2b;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
}
.face-toggle-btn.active {
    background: #194a2b;
    color: white;
}

/* ---- UPLOAD FOTO ---- */
.carnet-photo-upload-area {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.carnet-upload-label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 2px dashed #194a2b;
    color: #194a2b;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
    transition: all 0.2s;
}
.carnet-upload-label:hover { background: #eaf3ea; }

/* ---- BOTONES DESCARGA ---- */
.carnet-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.action-btn {
    padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer;
    font-weight: bold; transition: 0.3s;
}
.cn-download-btn, .cn-download-btn-reverso {
    background: #194a2b;
    color: white;
    padding: 12px 26px;
    border-radius: 8px;
    font-size: 0.9rem;
}
.cn-download-btn:hover:not(:disabled), .cn-download-btn-reverso:hover { transform: translateY(-2px); opacity:0.9; }

/* ===================================== */
/* RESPONSIVO PARA MÓVILES (ZOOM ESCALADO)*/
/* ===================================== */
@media (max-width: 650px) {
    .carnet-preview-wrapper {
        transform: scale(0.65); /* Escala la tarjeta en vez de romper el diseño exacto */
        transform-origin: top center;
        margin-bottom: -120px; /* Compensa la reducción de altura visual */
    }
}

/* ---- ESTILOS FORMULARIO FRACCIONADO ---- */
.form-section-block {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-left: 5px solid #28a745; /* Indicador visual verde */
}

.block-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.step-number {
    background: #28a745;
    color: white;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-weight: bold;
    margin-right: 15px;
}

.block-header h3 {
    margin: 0;
    color: #2e2e2e;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Dos columnas */
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.input-group input, .input-group select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

.full-width {
    grid-column: 1 / -1; /* Ocupa todo el ancho */
}

.big-save {
    width: 100%;
    font-size: 1.2rem;
    padding: 15px;
    margin-bottom: 50px;
}

/* RESPONSIVE PARA FORMULARIO */
@media (max-width: 768px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}

/* ---- ESTILOS BIOMETRIA (MODIFICADO) ---- */
.biometric-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.camera-area, .video-verify-area {
    flex: 1;
    min-width: 300px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.video-box {
    width: 100%; height: 200px;
    background: #000;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
    display: flex; justify-content: center; align-items: center;
}
#video-stream, #photo-preview { width: 100%; height: 100%; object-fit: cover; }
#video-stream { transform: scaleX(-1); }

.btn-action {
    padding: 8px 15px; border-radius: 5px; cursor: pointer; border: 1px solid #ccc;
    font-weight: bold; transition: 0.2s;
}
.outline { background: white; color: #333; }
.solid { background: #28a745; color: white; border: none; }
.solid-red { background: #dc3545; color: white; border: none; }
.status-pending { margin: 10px 0; font-weight: bold; color: #777; }

/* ---- NUEVO DISEÃ‘O DE CARNET: BLANCO Y LIMPIO ---- */
.carnet-white-theme {
    width: 550px; /* Ancho tarjeta crÃ©dito aumentado proporcionalmente */
    height: 320px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    overflow: hidden;
    position: relative;
    border: 1px solid #e1e1e1;
    display: flex;
    flex-direction: column;
}

.cw-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding-left: 20px;
    /* Un toque sutil decorativo en la cabecera */
    background-image: url('../img/texture.png'); /* Opcional, o fondo blanco puro */
    border-bottom: 2px solid #28a745;
}

.cw-logo {
    height: 50px; /* Logo a color */
}

.cw-body {
    flex: 1;
    display: flex;
    padding: 15px 20px;
    align-items: center;
    gap: 20px;
}

.cw-photo-frame {
    width: 110px; height: 130px;
    border: 2px solid #eee;
    padding: 2px;
    border-radius: 5px;
}
.cw-photo-frame img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

.cw-info {
    flex: 1;
}

.cw-info h2 {
    color: #2e2e2e;
    font-size: clamp(0.75rem, 2.5vw, 1.1rem);
    font-weight: 900;
    margin-bottom: 2px;
    text-transform: uppercase;
    word-break: break-word;
    overflow-wrap: break-word;
}

.cw-info h3 {
    color: #555;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.cw-data-row {
    display: flex;
    gap: 15px;
    margin-bottom: 6px;
}
.cw-data-item {
    display: flex; flex-direction: column;
}
.cw-data-item span {
    font-size: 0.6rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px;
}
.cw-data-item p {
    font-size: 0.85rem; color: #333; font-weight: 700; line-height: 1.2;
}

.cw-qr-box {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    padding: 5px;
}
#qrcode img {
    width: 100%;
}

.cw-footer {
    height: 35px;
    background: #2e2e2e;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* RESPONSIVE SCALE para MÃ³viles (Escalar el carnet si es muy grande) */
@media (max-width: 600px) {
    .carnet-white-theme {
        transform: scale(0.65);
        margin: -40px -80px; /* Compensar espacio por scale */
    }
}

/* PERFIL */
.profile-blocks-grid-obsolete {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.profile-card {
    background: white; border-radius: 10px; padding: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
#show-org, #show-cc, #show-camp, #show-comuna, #show-rif {
    font-weight: bold; font-size: clamp(0.4rem, 5vw, 1.2rem); text-align: center; align-self: center; margin-left: 5px;
}
.profile-card h3 { text-align: center; 
    font-size: clamp(0.4rem, 5vw, 1.5rem);}
.main-card { text-align: center; }
.profile-header-img img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 4px solid #f4f7f6;}
.data-list { list-style: none; padding: 0; }
.data-list li {
    padding: 10px 0; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between;
}
.data-list li strong { text-align: right; color: #2e2e2e; }

/* RESPONSIVE PERFIL */
@media (max-width: 768px) {
    .profile-blocks-grid-obsolete {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 80%;
    margin: auto;
}
    #profile-name {
    text-align: center; 
    font-size: clamp(0.4rem, 5vw, 1.5rem); }
}
/* MODAL SCANNER */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 2000; display:flex; justify-content:center; align-items:center; }
.modal-content { background:white; width:90%; max-width:400px; border-radius:15px; overflow:hidden; position: relative; }
.modal-header { background:#2e2e2e; padding:20px; color:white; display:flex; align-items:center; justify-content:space-between; }
.modal-logo { height:30px; filter: brightness(0) invert(1); }
.modal-body { padding:20px; text-align:center; }
.modal-photo { width:100px; height:100px; border-radius:50%; margin-top:-50px; border:4px solid white; object-fit:cover; background: #ddd; }
.close-modal { 
    position: absolute; 
    right: 15px; 
    top: 15px; 
    font-size: 28px; 
    color: #fff; 
    background: rgba(0,0,0,0.3); 
    border: none; 
    cursor: pointer; 
    z-index: 100;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.close-modal:hover { background: rgba(0,0,0,0.5); }

/* ---- WIZARD DE PRODUCCION MEJORADO (Estilo Premium) ---- */

/* Ajuste del Modal para el Wizard */
#production-modal .modal-content {
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border: none;
}

/* Animacion de Pasos */
.wizard-step {
    animation: slideUpFade 0.4s ease-out;
}
@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grid de Nichos Inteactivo */
.niche-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.niche-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}
.niche-card:hover { transform: translateY(-3px); }

/* Ocultar el radio nativo accesiblmente */
.niche-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

/* Caja Visual del Nicho */
.niche-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid #eaeaea;
    border-radius: 12px;
    padding: 20px 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
    min-height: 120px;
    color: #555;
}

.niche-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
    filter: grayscale(100%);
    transition: filter 0.3s;
}

/* Estado Seleccionado */
.niche-card input:checked + .niche-box {
    border-color: #28a745;
    background: linear-gradient(to bottom right, #f0fff4, #ffffff);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.15);
    color: #1e2e1e;
    transform: scale(1.02);
}
.niche-card input:checked + .niche-box .niche-icon {
    filter: grayscale(0%);
    transform: scale(1.1);
}
.niche-card input:checked + .niche-box span {
    font-weight: 700;
    color: #28a745;
}

/* Botones CTA Premium */
.hero-cta-button {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 10px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hero-cta-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(40, 167, 69, 0.4);
    filter: brightness(1.1);
}
.hero-cta-button:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Inputs y Selects Aesthetics */
.input-group label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    display: block;
}
.input-group input, .input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background-color: #f9f9f9;
}
.input-group input:focus, .input-group select:focus {
    border-color: #28a745;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Grillas DinÃ¡micas */
.dynamic-section {
    display: grid;
    gap: 20px;
    animation: fadeIn 0.3s ease-in;
}

/* Spinner Custom */
.spinner {
    border: 4px solid rgba(0,0,0,0.05);
    border-left-color: #28a745;
}

/* RESULTADOS ESTILO */
#ai-result h2 { font-size: 1.5rem; margin-top: 0; }
#res-rubro-title { text-decoration: underline; text-decoration-color: #28a745; text-underline-offset: 5px; }


/* RESPONSIVE OPTIMIZATIONS ( MOBILE FIRST ) */
@media (max-width: 768px) {
    /* Modal Full Screen en mÃ³vil para mejor uso */
    #production-modal .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        max-width: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    #production-modal .modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 15px !important;
    }
    
    /* Grid de nichos a 2 columnas */
    .niche-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Inputs stacking */
    .form-grid-2, .dynamic-section {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    /* Ajuste de grÃ¡ficos en mÃ³vil */
    #ai-result > div[style*="grid"] {
        grid-template-columns: 1fr !important; /* Stack grÃ¡ficos vertically */
    }
    
    /* Botones mÃ¡s grandes para dedos */
    .hero-cta-button, .btn-action {
        width: 100%;
        padding: 16px;
        margin-bottom: 10px;
    }
}

/* AJUSTES SOLICITADOS (Z-Index Header y Padding H3) */
#production-modal .modal-header {
    position: relative;
    z-index: 10;
}

#step-prod-2 h3 {
    padding-top: 15px; /* Un pequeÃ±o padding top extra */
    font-size: clamp(1rem, 2.5vw, 1.4rem); /* Texto Responsivo */
}

/* Padding para el TÃ­tulo de ProyecciÃ³n (Solicitado) */
#ai-result h2 {
    padding-top: 15px;
    font-size: clamp(1.2rem, 3vw, 1.8rem); /* Texto Responsivo */
}

/* Contenedor de GrÃ¡ficos Flexbox (Solicitado) */
.charts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-box {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    height: 300px;
    position: relative; /* Ensure it contains the canvas correctly */
}

.main-chart {
    flex: 2;
    min-width: 300px; /* Evita que se aplaste demasiado */
}

.pie-chart {
    flex: 1;
    min-width: 250px;
}

/* En mÃ³viles, que ocupen todo el ancho */
@media (max-width: 600px) {
    .main-chart, .pie-chart {
        flex: 1 1 100%;
        min-width: 100%;
    }
}
/* --- NUEVOS ESTILOS PARA PERFIL MODULAR --- */
.profile-blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.profile-block-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-left: 6px solid #28a745;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.profile-block-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.2);
}

.block-icon-container {
    width: 70px;
    height: 70px;
    background: #f0fff4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #28a745;
    font-size: 2rem;
}

.block-index {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #eee;
    color: #666;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.block-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: #fdfdfd;
    border: 1px solid #ddd;
    color: #888;
}

.profile-block-card.completed .block-status {
    background: #e6ffed;
    color: #28a745;
    border-color: #bef5cb;
}

/* Modal Full Screen */
.modal-full {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 3000;
    display: none;
    flex-direction: column;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-full-header {
    background: #1e2e1e;
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.modal-full-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-close-full {
    background: none;
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.btn-close-full:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

.modal-full-body {
    flex: 1;
    overflow-y: auto;
    padding: 50px 20px;
    display: flex;
    justify-content: center;
}

.modal-full-container {
    width: 100%;
    max-width: 800px;
}

.modal-section-title {
    color: #28a745;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* ---- UTILITIES FOR MODALS (Refactor) ---- */
.radio-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.radio-box label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.description-text {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-full-footer {
    padding: 15px 30px;
    border-top: 1px solid #eee;
    background: #fdfdfd;
    display: flex;
    justify-content: space-between; /* Adjusted for back arrow on left and buttons on right */
    align-items: center;
    gap: 15px;
}

/* --- ESTILOS PARA NAVEGACIÓN Y BOTÓN VOLVER --- */
.nav-aligned-row {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    margin-bottom: 30px;
    min-height: 40px; /* Asegura espacio para la flecha */
}

.nav-aligned-row .btn-back-minimal {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.nav-aligned-row p {
    flex: 1;
    margin-bottom: 0 !important;
    padding: 0 40px; /* Deja espacio para la flecha a los lados si es necesario */
}

.section-header-nav {
    display: none; /* Reemplazado por nav-aligned-row */
}

.btn-back-minimal, .btn-back-minimal-modal {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    outline: none;
    box-shadow: none !important;
}

.btn-back-minimal:hover, .btn-back-minimal-modal:hover {
    transform: scale(1.1);
}

.btn-back {
    background: white;
    border: 1px solid #28a745;
    color: #28a745;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    margin-bottom: 15px;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-back:hover {
    background: #28a745;
    color: white;
    transform: translateX(-3px);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.2);
}

.btn-back svg {
    transition: transform 0.2s;
}

.btn-back:hover svg {
    transform: translateX(-2px);
}

/* Styled Textarea (Non-resizable, Aesthetic) */
.styled-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #f9f9f9;
    resize: none; /* User cannot manually resize */
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    line-height: 1.5;
    color: #333;
    display: block;
    box-sizing: border-box;
}

.styled-textarea:focus {
    border-color: #28a745;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* ---- SELECTION CHIPS (Checkbox estilo premium) ---- */
.selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.selection-chip {
    display: block;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #fafafa;
    position: relative;
}

.selection-chip:hover {
    border-color: #a5d6a7;
    background: #f0fff4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.1);
}

/* Ocultar checkbox nativo */
.selection-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.chip-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Círculo personalizado (reemplaza checkbox) */
.custom-circle {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
}

.custom-circle::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.chip-content span {
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
    transition: color 0.2s;
}

/* Estado seleccionado */
.selection-chip input:checked ~ .chip-content .custom-circle {
    background: #28a745;
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.selection-chip input:checked ~ .chip-content .custom-circle::after {
    transform: translate(-50%, -50%) scale(1);
}

.selection-chip input:checked ~ .chip-content span {
    color: #1b5e20;
    font-weight: 700;
}

.selection-chip:has(input:checked) {
    border-color: #28a745;
    background: linear-gradient(135deg, #f0fff4 0%, #e8f5e9 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.12);
}

/* Sub-input que aparece al seleccionar */
.chip-sub-input {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin-top 0.3s ease;
    margin-top: 0;
}

.selection-chip input:checked ~ .chip-sub-input,
.chip-sub-input.show {
    max-height: 150px;
    margin-top: 12px;
}

.chip-sub-input input,
.chip-sub-input textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    font-size: 0.88rem;
    background: white;
    font-family: inherit;
}

.chip-sub-input input:focus,
.chip-sub-input textarea:focus {
    border-color: #28a745;
    outline: none;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}

/* ---- INDICADOR DE ESTADO INCOMPLETO (Amarillo/Ámbar) ---- */
.profile-block-card.incomplete .block-status {
    background: #fff8e1;
    color: #f57f17;
    border-color: #ffe082;
}

.profile-block-card.incomplete {
    border-left-color: #ffa726;
}

@media (max-width: 768px) {
    .selector-grid {
        grid-template-columns: 1fr;
    }
}

/* --- ESTILOS PARA LISTAS DE DATOS DE PERFIL (UI) --- */
.profile-data-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    text-align: left;
    font-size: 0.85rem;
    color: #555;
}
.profile-data-list li {
    margin-bottom: 6px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 4px;
    line-height: 1.3;
}
.profile-data-list li strong {
    color: #333;
}
.highlight-ubicacion {
    background: #f0fff4;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid #28a745;
    margin-bottom: 10px;
}
