/**
 * CIEM IA+ · Fase 1 — Lienzo homogéneo (patrón Fase 3.5)
 * Alcance: solo #fase1, #ciem_f1_shell y descendientes. Sin body/html/nav globales.
 * @deploy-marker CIEM_FASE1_LAYOUT_HOMOGENEO_2026-05-28
 */

#fase1.ciem-f1-wrap,
#fase1.ciem-f1-wrap .ciem-f1-shell {
    box-sizing: border-box;
    max-width: 100%;
}

#fase1.ciem-f1-wrap {
    overflow: visible;
    position: relative;
    z-index: 1;
}

#ciem_f1_shell.ciem-f1-shell {
    scroll-margin-top: 88px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    position: relative;
}

#fase1 .ciem-f1-body {
    padding: 0 4px 28px;
    overflow: visible;
}

#fase1 .ciem-f1-hero {
    margin-bottom: 22px;
    padding: 22px 24px;
    background: #0f172a;
    border-radius: 12px;
    border-left: 6px solid #38bdf8;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#fase1 .ciem-f1-hero h3 {
    color: #38bdf8;
    margin-top: 0;
}

#fase1 .ciem-f1-hero p {
    color: #ffffff;
    line-height: 1.7;
    font-size: 1.05rem;
    margin: 0;
}

#fase1 .ciem-f1-hero-actions {
    margin-top: 18px;
}

/* Botón Mentor · Cimientos (Grado A) */
#fase1 .ciem-f1-btn-mentor-ideacion,
#fase1 a.ciem-f1-btn-mentor-ideacion,
#ciem_f11_origen .ciem-f11-btn-mentor,
#ciem_f11_origen a.ciem-f11-btn-mentor,
#consultarMentor,
a#consultarMentor {
    display: inline-block;
    background-color: #6c5ce7;
    background: linear-gradient(180deg, #7c6cf0 0%, #6c5ce7 55%, #5b4cdb 100%);
    color: #ffffff !important;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    text-decoration: none !important;
    font-weight: bold;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    line-height: 1.35;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    margin-bottom: 20px;
    cursor: pointer;
    box-sizing: border-box;
}

#fase1 .ciem-f1-btn-mentor-ideacion:hover,
#ciem_f11_origen .ciem-f11-btn-mentor:hover,
#consultarMentor:hover,
a#consultarMentor:hover {
    background-color: #5b4cdb;
    filter: brightness(1.06);
    box-shadow: 0 6px 14px rgba(108, 92, 231, 0.35);
    transform: translateY(-1px);
    color: #ffffff !important;
    text-decoration: none !important;
}

#fase1 .ciem-f1-recursos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

#fase1 .ciem-f1-recurso-cell {
    text-align: center;
    padding: 12px;
    background: #1e293b;
    border-radius: 8px;
    border: 1px solid #334155;
}

#fase1 .ciem-f1-recurso-cell a {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
}

#fase1 .ciem-f1-recurso-cell a.ciem-f1-link-verde {
    color: #4ade80;
}

#fase1 .ciem-f1-recurso-cell a.ciem-f1-link-cian {
    color: #38bdf8;
}

#fase1 .ciem-f1-dual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 25px;
}

#fase1 .ciem-f1-panel-blanco {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

#fase1 .ciem-f1-panel-blanco strong {
    color: #1e293b;
    font-size: 1.1rem;
    display: block;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

#fase1 .ciem-f1-panel-blanco strong.ciem-f1-borde-cian {
    border-bottom: 2px solid #38bdf8;
}

#fase1 .ciem-f1-panel-blanco strong.ciem-f1-borde-verde {
    border-bottom: 2px solid #4ade80;
}

#fase1 .ciem-f1-panel-blanco ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.8;
}

#fase1 .ciem-f1-agentes {
    margin-top: 10px;
}

#fase1 .ciem-f1-video-box,
#fase1 .video-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    clear: both;
    position: relative;
    overflow: visible;
    flex-wrap: nowrap;
}

#fase1 .ciem-f1-video-box .btn-agente,
#fase1 .ciem-f1-video-box .ciem-f1-row-agente,
#fase1 .video-box .btn-agente {
    display: block;
    width: 100%;
    max-width: 640px;
    margin: 0;
    box-sizing: border-box;
    flex: 0 0 auto;
}

#fase1 .ciem-f1-video-box .ciem-f1-nota,
#fase1 .video-box .ciem-f1-nota {
    display: block;
    width: 100%;
    max-width: 640px;
    margin: 0;
    padding: 0 0 4px 0;
    flex: 0 0 auto;
}

#fase1 .ciem-f1-video-box .btn-video-ia,
#fase1 .video-box .btn-video-ia {
    display: inline-block;
    flex: 0 0 auto;
    align-self: flex-start;
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 8px 16px;
    white-space: normal;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

#fase1 .ciem-f1-deslinde-mentor {
    background-color: #f8f9fa;
    border-left: 4px solid #6c5ce7;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 25px;
    max-width: 100%;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    line-height: 1.55;
    color: #1e293b;
}

#fase1 .ciem-f1-recurso-cell {
    min-width: 0;
    overflow: hidden;
    word-wrap: break-word;
}

#fase1 .ciem-f1-recurso-cell a {
    display: block;
    white-space: normal;
    line-height: 1.35;
}

#fase1 .ciem-f1-nota {
    margin-top: 6px;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    font-style: italic;
    color: #0369a1;
    line-height: 1.35;
}

#fase1 .ciem-f1-row-agente {
    width: 100%;
    margin: 0;
}

#fase1 .ciem-f1-row-agente--grow {
    flex: 1 1 auto;
    min-width: 0;
}

/* Sin desplazamiento del sidebar (contenedores raíz solamente) */
#fase1.ciem-f1-wrap,
#fase1 .ciem-f1-shell,
#ciem_fase1_pestanas,
#ciem_rutas_selector,
.ciem-fase1-viewport {
    margin-left: 0 !important;
    left: auto !important;
    position: relative !important;
    float: none !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

#fase1 .ciem-f1-body,
#ciem_f11_origen.ciem-f11-origen {
    margin-left: 0 !important;
    position: relative !important;
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* —— Formularios Grado A: etiqueta arriba, campo abajo —— */
#fase1 .ciem-f1-body label,
#ciem_f11_origen label.ciem-f11-lbl {
    display: block;
    width: 100%;
    max-width: 640px;
    margin: 0 0 4px 0;
    font-weight: 900;
    font-size: 0.92rem;
    color: #0f172a;
    line-height: 1.45;
}

#fase1 .ciem-f1-body input[type="text"],
#fase1 .ciem-f1-body input[type="email"],
#fase1 .ciem-f1-body input[type="number"],
#fase1 .ciem-f1-body input[type="search"],
#fase1 .ciem-f1-body textarea,
#fase1 .ciem-f1-body select,
#ciem_f11_origen input[type="text"],
#ciem_f11_origen textarea,
#ciem_f11_origen select,
#ciem_f11_origen .ciem-f11-input,
#ciem_f11_origen .ciem-f11-textarea {
    display: block;
    width: 100%;
    max-width: 600px;
    margin: 0 0 15px 0;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #ffffff;
    color: #0f172a;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    line-height: 1.45;
    box-sizing: border-box;
}

#fase1 .ciem-f1-body textarea,
#ciem_f11_origen textarea,
#ciem_f11_origen .ciem-f11-textarea {
    min-height: 72px;
    resize: vertical;
}

#ciem_f11_origen .ciem-f11-campos {
    margin-top: 14px;
    display: block;
    max-width: 640px;
}

#ciem_f11_origen .ciem-f11-grid-2 {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 640px;
    gap: 0;
    margin: 0 0 4px;
    padding: 0;
}

#ciem_f11_origen .ciem-f11-grid-2 .ciem-f11-lbl {
    display: block;
    width: 100%;
    max-width: 600px;
    margin-bottom: 4px;
}

#ciem_f11_origen .ciem-f11-grid-2 .ciem-f11-input,
#ciem_f11_origen .ciem-f11-grid-2 input[type="text"] {
    display: block;
    width: 100%;
    max-width: 600px;
    margin-bottom: 12px;
}

#fase1 .ciem-f1-regla-oro {
    font-size: 0.85rem;
    margin-top: 10px;
    color: #c0392b;
    font-weight: bold;
}

#fase1 .ciem-f1-modulos {
    margin-top: 28px;
    padding-top: 8px;
    border-top: 2px solid #e2e8f0;
}

/* Fase 1.1 — Origen psicométrico */
#ciem_f11_origen.ciem-f11-origen {
    margin-top: 18px;
    padding: 18px;
    border-radius: 14px;
    border: 2px solid #38bdf8;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    font-family: Arial, sans-serif;
    font-size: 12pt;
    box-sizing: border-box;
    max-width: 100%;
    overflow: visible;
    position: relative;
}

#ciem_f11_origen .ciem-f11-cabecera {
    margin: 8px 0 18px;
    padding: 16px;
    border-radius: 14px;
    background: #020617;
    border: 1px solid rgba(34, 211, 238, 0.35);
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.28);
}

#ciem_f11_origen .ciem-f11-cabecera-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 14px;
    flex-wrap: wrap;
}

#ciem_f11_origen .ciem-f11-cabecera-titulo {
    font-size: 12pt;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

#ciem_f11_origen .ciem-f11-btn-reset {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(34, 211, 238, 0.55);
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.9), rgba(15, 23, 42, 0.95));
    color: #a5f3fc;
    font-weight: 900;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    box-shadow: 0 10px 22px rgba(34, 211, 238, 0.1);
}

#ciem_f11_origen .ciem-f11-lead {
    font-weight: 700;
    color: #0369a1;
    margin: 0 0 14px;
    line-height: 1.5;
}

#ciem_f11_origen .ciem-f11-desc {
    color: #334155;
    margin: -6px 0 14px;
    line-height: 1.55;
}

#ciem_f11_origen .ciem-f11-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

#ciem_f11_origen .ciem-f11-top-main {
    min-width: 260px;
    flex: 1;
}

#ciem_f11_origen .ciem-f11-top-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

#ciem_f11_origen .ciem-f11-h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 900;
    color: #0f172a;
}

/* .ciem-f11-btn-mentor: estilos unificados arriba con .ciem-f1-btn-mentor-ideacion */

#ciem_f11_origen .ciem-f11-sub {
    font-size: 0.9rem;
    line-height: 1.55;
    color: #334155;
}

#ciem_f11_origen .ciem-f11-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    font-weight: 900;
    font-size: 0.82rem;
    color: #0f172a;
}

/* Alertas y reglas CIEM */
#ciem_f11_origen .ciem-f11-banner,
#ciem_f11_origen .ciem-f11-banner--manual,
#ciem_f11_origen #ciem_f11_banner_origen {
    padding: 12px;
    border-radius: 6px;
    background-color: #fff5f5;
    border: 1px solid #fecaca;
    border-left: 4px solid #e74c3c;
    margin: 15px 0;
    font-weight: 800;
    font-size: 0.85rem;
    line-height: 1.45;
    color: #9a3412;
    max-width: 640px;
    box-sizing: border-box;
}

#ciem_f11_origen .ciem-f11-regla,
#ciem_f11_origen .ciem-f11-aviso {
    padding: 12px;
    border-radius: 6px;
    background-color: #fff5f5;
    border: 1px solid #fecaca;
    border-left: 4px solid #e74c3c;
    margin: 15px 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #7c2d12;
    max-width: 640px;
    box-sizing: border-box;
}

#ciem_f11_origen .ciem-f11-regla {
    flex: none;
    min-width: 0;
    width: 100%;
}

#ciem_f11_origen .ciem-f11-aviso {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    border-left-color: #64748b;
    color: #475569;
    font-style: italic;
}

#ciem_f11_origen .ciem-f11-alert {
    display: none;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #f59e0b;
    background: #fffbeb;
    color: #7c2d12;
    font-weight: 900;
    font-size: 0.9rem;
    line-height: 1.45;
}

#ciem_f11_origen .ciem-f11-btn-validar {
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(180deg, #38bdf8, #0ea5e9);
    color: #0f172a;
    font-weight: 1000;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    box-shadow: 0 12px 28px rgba(56, 189, 248, 0.22);
}

#ciem_f11_origen .ciem-f11-btn-sync {
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid #0ea5e9;
    background: linear-gradient(180deg, #f0f9ff, #ffffff);
    color: #0c4a6e;
    font-weight: 1000;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 12pt;
    box-shadow: 0 10px 22px rgba(14, 165, 233, 0.18);
}

#ciem_f11_origen .ciem-f11-regla small {
    font-size: 0.78rem;
    color: #64748b;
    font-style: italic;
}

#ciem_f11_origen .ciem-f11-acciones {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    max-width: 640px;
}

#ciem_f11_origen .ciem-f11-btn-validar,
#ciem_f11_origen .ciem-f11-btn-sync {
    display: inline-block;
    width: auto;
    max-width: 100%;
    margin-bottom: 0;
}

/* Pestañas 1.1 / 1.2: nunca heredan estilos de sidebar */
#ciem_fase1_pestanas.ciem-f12-pestanas,
#ciem_rutas_selector.ciem-rutas-selector {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    z-index: 30 !important;
    transform: none !important;
    margin-left: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border-right: none !important;
    display: block !important;
    flex-direction: column !important;
    visibility: visible !important;
}

@media (max-width: 900px) {
    #fase1 .ciem-f1-recursos-grid {
        grid-template-columns: 1fr;
    }
    #fase1 .ciem-f1-dual-grid {
        grid-template-columns: 1fr;
    }
    #ciem_f11_origen .ciem-f11-grid-2 {
        flex-direction: column;
    }
}
