/* ============================================================
   POSGRADO-MIA — Sitio web oficial de la Maestría en Ingeniería Administrativa
   Instituto Tecnológico de Cuautla (TecNM)
   © 2026 Juan Antonio Galindo García. Todos los derechos reservados.
   ============================================================ */
/* POSGRADO-MIA - Estilos modernos v2 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #1e3a5f;
    --primary-light: #2d5a8e;
    --accent: #f0a500;
    --accent-light: #ffc107;
    --gradient: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 50%, #1a2744 100%);
    --gradient-accent: linear-gradient(135deg, #f0a500 0%, #ff6b35 100%);
    /* Guinda institucional (identidad gráfica CENIDET — franja superior e inferior) */
    --guinda: #611232;
    --guinda-dark: #4a0d26;
    --dark: #0f1923;
    --text: #2d3748;
    --text-light: #718096;
    --bg: #f8fafc;
    --card-shadow: 0 4px 24px rgba(0,0,0,0.06);
    --card-hover: 0 12px 40px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

/* ============================================================ */
/* FRANJA GOBIERNO DE MÉXICO (identidad gráfica sitio oficial) */
/* ============================================================ */
.gob-bar {
    background: var(--guinda);
    padding: 3px 0;
}
.gob-bar .container {
    min-height: 26px;
    padding-top: 0;
    padding-bottom: 0;
}
.gob-logo { display: inline-flex; align-items: center; line-height: 0; }
.gob-logo img { height: 24px; width: auto; object-fit: contain; }
.gob-links { display: flex; align-items: center; gap: 10px; font-size: 0.72rem; color: rgba(255,255,255,0.75); }
.gob-links a { color: rgba(255,255,255,0.75); text-decoration: none; font-weight: 500; transition: color 0.2s; }
.gob-links a:hover { color: #fff; text-decoration: underline; }
.gob-links span { color: rgba(255,255,255,0.35); }

/* ============================================================ */
/* BARRA INSTITUCIONAL TecNM */
/* ============================================================ */
.institucional-bar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 6px 0;
}
.institucional-logos {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.institucional-logos a { display: inline-flex; align-items: center; line-height: 0; }
.institucional-logos img { height: 34px; width: auto; object-fit: contain; }
.institucional-logos img.logo-itc { height: 40px; }
.institucional-sep {
    width: 1px;
    height: 26px;
    background: #d1d5db;
}
.institucional-links { display: flex; align-items: center; gap: 10px; font-size: 0.75rem; color: #4b5563; }
.institucional-links a { color: #4b5563; text-decoration: none; font-weight: 500; }
.institucional-links a:hover { color: var(--primary); }

/* ============================================================ */
/* NAVBAR */
/* ============================================================ */
.navbar {
    background: var(--guinda) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 2px 12px rgba(97,18,50,0.35);
    padding: 0;
}
.navbar-logo-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 10px;
    padding: 3px;
    margin-right: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.navbar-logo-chip img { height: 32px; width: auto; display: block; }
.navbar .container { padding-top: 0; padding-bottom: 0; }
.navbar-brand {
    font-weight: 800 !important;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    padding: 14px 0;
}
.navbar-brand i { color: var(--accent); }
.navbar .nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 14px 12px !important;
    color: rgba(255,255,255,0.7) !important;
    transition: color 0.2s;
    letter-spacing: 0.3px;
}
.navbar .nav-link:hover { color: #fff !important; }

/* ============================================================ */
/* HERO SECTION */
/* ============================================================ */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--dark);
    padding: 0;
    line-height: 0;
}
.hero-banner-link {
    display: block;
    position: relative;
    line-height: 0;
}
.hero-banner-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}
.hero-banner-link .hero-banner-cta {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15,25,35,0.88);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    padding: 10px 24px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 2;
    pointer-events: none;
}
.hero-banner-link:hover .hero-banner-cta,
.hero-banner-link:focus-visible .hero-banner-cta { opacity: 1; }

/* ============================================================ */
/* CARRUSEL DE AVISOS (portada) */
/* ============================================================ */
.hero-carousel { position: relative; overflow: hidden; line-height: 0; }
.hero-carousel .carousel-inner { line-height: 0; }
.hero-carousel .carousel-item { line-height: 0; }
.hero-carousel .carousel-indicators { z-index: 4; margin-bottom: 14px; }
.hero-carousel .carousel-indicators [data-bs-target] {
    width: 10px; height: 10px; border-radius: 50%;
    background-color: rgba(255,255,255,0.6); border: 0; opacity: 1;
}
.hero-carousel .carousel-indicators .active { background-color: var(--accent); }

/* Slide sin imagen: usa el gradiente institucional */
.hero-slide-noimg {
    width: 100%;
    height: clamp(380px, 62vh, 680px);
    background: var(--gradient);
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Leyenda siempre visible abajo-izquierda */
.hero-banner-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    max-width: 680px;
    padding: 52px 32px 42px;
    background: linear-gradient(to top, rgba(15,25,35,0.92) 0%, rgba(15,25,35,0.45) 55%, transparent 100%);
    text-align: left;
}
.hero-banner-tag {
    display: inline-flex;
    align-items: center;
    background: var(--accent);
    color: #0f1923;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 100px;
    line-height: 1.4;
}
.hero-banner-title {
    display: block;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.5px;
}
.hero-banner-text {
    display: block;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
    max-width: 560px;
}
.hero-banner-caption .hero-banner-cta {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    padding: 8px 18px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.8rem;
    opacity: 1;
    margin-top: 12px;
    pointer-events: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next { width: 9%; z-index: 5; }
.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background-color: rgba(15,25,35,0.55);
    background-size: 55%;
    background-position: center;
}

/* Stats row (debajo del banner, tarjeta moderna) */
.hero-stats {
    display: flex;
    gap: 2px;
    justify-content: center;
    background: rgba(15,25,35,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 4px;
    max-width: 820px;
    margin: 36px auto 0;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: var(--card-hover);
}
.hero-stat {
    flex: 1;
    text-align: center;
    padding: 20px 12px;
    border-radius: var(--radius-sm);
    background: transparent;
    transition: background 0.3s;
}
.hero-stat:hover { background: rgba(255,255,255,0.05); }
.hero-stat .number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 4px;
}
.hero-stat .label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ============================================================ */
/* SECTION TITLES */
/* ============================================================ */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}
.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 28px;
}

/* ============================================================ */
/* CARDS MODERNAS */
/* ============================================================ */
.card-modern {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    height: auto;
    flex: 1 0 auto; /* crece para igualar altura sin desbordar la columna */
    overflow: hidden;
}
.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover);
}
.card-modern .card-body { padding: 28px; }
.card-modern .card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
    color: #fff;
}
.card-modern .card-icon.blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.card-modern .card-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.card-modern .card-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.card-modern .card-icon.purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.card-modern .card-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.card-modern .card-icon.teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.card-modern h5 {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary);
    margin-bottom: 8px;
}
.card-modern p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0;
    line-height: 1.6;
}
.card-modern a { text-decoration: none; color: inherit; }

/* Columnas como contenedores flex: permite tarjetas de igual altura
   sin que se desborden y cubran el footer cuando hay varias apiladas
   en una misma columna (ej. página de Contacto). */
.row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}
.row > [class*="col-"] > a {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

/* ============================================================ */
/* CONTENT SECTION (Perfil, Objetivos) */
/* ============================================================ */
.content-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 36px 40px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
}
.content-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.content-card h2 i { color: var(--accent); font-size: 1.5rem; }
.content-card p, .content-card li {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.8;
}

/* ============================================================ */
/* TABLE (Cohortes) */
/* ============================================================ */
.table-modern {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}
.table-modern table { margin-bottom: 0; }
.table-modern thead th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 18px;
    border: none;
}
.table-modern tbody td {
    padding: 12px 18px;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.table-modern tbody tr:last-child td { border-bottom: none; }
.table-modern tbody tr:hover { background: #f8fafc; }
.materia-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.materia-link:hover { text-decoration: underline; }

/* ============================================================ */
/* FOOTER */
/* ============================================================ */
footer {
    background: var(--guinda) !important;
    border-top: 1px solid rgba(255,255,255,0.08);
}
footer h6 {
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff !important;
    margin-bottom: 12px;
}
footer p, footer a { font-size: 0.82rem; }
footer hr { border-color: rgba(255,255,255,0.12) !important; }
/* Texto secundario legible sobre el azul institucional */
footer .text-secondary { color: rgba(255,255,255,0.78) !important; }
footer a.text-secondary:hover { color: #fff !important; }
.footer-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.footer-logos a { display: inline-flex; align-items: center; line-height: 0; }
.footer-logos img { height: 38px; width: auto; object-fit: contain; opacity: 0.9; transition: opacity 0.2s; }
.footer-logos a:hover img { opacity: 1; }
.footer-logos img.logo-itc { height: 46px; background: #fff; border-radius: 50%; padding: 3px; }
.footer-institucional-links { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.footer-institucional-links a { color: rgba(255,255,255,0.6); text-decoration: none; }
.footer-institucional-links a:hover { color: var(--accent); }

/* ============================================================ */
/* ASISTENTE VIRTUAL (CHATBOT) */
/* ============================================================ */
.pg-chat { position: fixed; right: 20px; bottom: 20px; z-index: 1080; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.pg-chat-toggle {
    width: 60px; height: 60px; border-radius: 50%; border: 0;
    background: var(--gradient); color: #fff; font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,.28); cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}
.pg-chat-toggle:hover { transform: scale(1.06); }
.pg-chat-toggle .pg-chat-close-icon { display: none; }
.pg-chat-toggle.abierto .pg-chat-open { display: none; }
.pg-chat-toggle.abierto .pg-chat-close-icon { display: block; }

.pg-chat-panel {
    width: min(360px, calc(100vw - 40px)); height: min(520px, 72vh);
    background: #fff; border-radius: 18px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,.22); border: 1px solid rgba(0,0,0,.06);
}
.pg-chat-panel[hidden] { display: none; }

.pg-chat-header { background: var(--gradient); color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.pg-chat-header-info { display: flex; align-items: center; gap: 10px; }
.pg-chat-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.pg-chat-header small { display: block; font-size: .72rem; opacity: .92; }
.pg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; margin-right: 4px; }
.pg-chat-close { background: none; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; opacity: .85; padding: 4px; }
.pg-chat-close:hover { opacity: 1; }

.pg-chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f6f8fb; }
.pg-msg { max-width: 85%; padding: 9px 13px; border-radius: 14px; font-size: .88rem; line-height: 1.45; white-space: pre-line; word-wrap: break-word; }
.pg-msg.bot { background: #fff; color: #1f2937; border: 1px solid #e5e7eb; border-bottom-left-radius: 4px; align-self: flex-start; }
.pg-msg.user { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }

.pg-chat-quick { padding: 8px 12px 2px; display: flex; flex-wrap: wrap; gap: 6px; background: #fff; border-top: 1px solid #f0f2f5; }
.pg-chip { background: #eef4fb; color: var(--primary); border: 1px solid #d3e2f3; border-radius: 999px; padding: 5px 12px; font-size: .78rem; cursor: pointer; transition: background .15s ease, color .15s ease; }
.pg-chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.pg-chat-form { display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid #eef0f3; }
.pg-chat-form input { flex: 1; border: 1px solid #d7dce3; border-radius: 999px; padding: 9px 14px; font-size: .88rem; outline: none; min-width: 0; }
.pg-chat-form input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(45,90,142,.12); }
.pg-chat-form button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--gradient-accent); color: #fff; font-size: 1.05rem; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pg-chat-form button:hover { filter: brightness(1.06); }

@media (max-width: 480px) {
    .pg-chat { right: 10px; bottom: 10px; }
    .pg-chat-panel { width: calc(100vw - 20px); height: min(540px, 78vh); border-radius: 16px; }
}
.footer-institucional-links .sep { color: rgba(255,255,255,0.2); }

/* Redes sociales (footer) — gestionables desde el panel admin */
.footer-social { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.footer-social a {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,0.12); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}
.footer-social a:hover { background: var(--accent); color: #1a2744; transform: translateY(-2px); }

/* ============================================================ */
/* PAGE HEADER INTERNAS */
/* ============================================================ */
.page-header {
    background: var(--gradient);
    padding: 40px 0;
    margin-bottom: 32px;
}
.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.page-header p { color: rgba(255,255,255,0.7); font-size: 0.9rem; margin-bottom: 0; }

/* ============================================================ */
/* RESPONSIVE */
/* ============================================================ */
@media (max-width: 768px) {
    .hero { padding: 0; }
    .hero-stats { margin: 28px auto 0; max-width: 94%; }
    .hero-stats { flex-wrap: wrap; gap: 1px; }
    .hero-stat { flex: 1 1 45%; padding: 14px 8px; }
    .hero-stat .number { font-size: 1.4rem; }
    .hero-slide-noimg { height: 280px; }
    .hero-banner-caption { padding: 34px 20px 30px; }
    .hero-banner-title { font-size: 1.25rem; }
    .hero-banner-text { font-size: 0.8rem; }
    .hero-carousel .carousel-indicators { margin-bottom: 8px; }
    .content-card { padding: 24px 20px; }
    .container { padding-left: 20px; padding-right: 20px; }
    .navbar .nav-link { padding: 10px 12px !important; font-size: 0.8rem; }
    .gob-bar .container { padding-left: 14px; padding-right: 14px; }
    .gob-logo img { height: 20px; }
    .institucional-bar { padding: 5px 0; }
    .institucional-logos { gap: 8px; justify-content: center; }
    .institucional-logos img { height: 26px; }
    .institucional-logos img.logo-itc { height: 30px; }
    .institucional-sep { height: 20px; }
    .footer-logos img { height: 30px; }
    .footer-logos img.logo-itc { height: 38px; }
}

/* En escritorio: ancho completo con altura limitada (recorte vertical) */
@media (min-width: 769px) {
    .hero-banner-img {
        height: clamp(380px, 62vh, 680px);
        object-fit: cover;
        object-position: 50% 55%;
    }
}
