/* ==============================================================================
   TOTALISYS COLLEGE — assets/css/site.css
   ------------------------------------------------------------------------------
   Estilos exclusivos del sitio corporativo público (index.html).
   El elemento "firma" de esta página es el ANILLO ORBITAL del hero: retoma
   directamente la composición del logo (nodos de módulos alrededor de un
   check central de verificación) y lo convierte en el mapa de los 11
   módulos reales del software — no es un adorno genérico, es el propio
   diagrama de arquitectura del producto.
   ============================================================================== */

/* --- Header / navegación --- */
.tc-nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(246, 249, 248, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--tc-line);
}
.tc-nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: var(--tc-max); margin: 0 auto; }
.tc-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.tc-brand img { height: 48px; width: auto; }
.tc-brand span { font-family: var(--tc-font-display); font-weight: 700; color: var(--tc-navy); font-size: 1.15rem; }
.tc-nav-links { display: flex; align-items: center; gap: 28px; }
.tc-nav-links a { color: var(--tc-ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.tc-nav-links a:hover { color: var(--tc-blue); }
.tc-lang-toggle {
    font-family: var(--tc-font-mono); font-size: 0.82rem; font-weight: 500;
    border: 1px solid var(--tc-line); border-radius: 999px; padding: 6px 14px;
    background: var(--tc-white); cursor: pointer; color: var(--tc-navy);
}
.tc-nav-burger { display: none; }

@media (max-width: 860px) {
    /* Antes se ocultaba con transform: translateY(-110%), pero ese porcentaje
       se calcula sobre la altura del propio elemento — con position:fixed +
       inset en las 4 direcciones, esa altura no se resuelve de forma
       confiable en todos los navegadores, y el menú podía quedar visible
       superpuesto sobre el contenido en vez de oculto. display:none/flex
       no tiene esa ambigüedad: siempre es "no está" o "está", sin cálculos
       de porcentaje de por medio. */
    .tc-nav-links {
        display: none; position: fixed; top: 62px; right: 0; left: 0; height: calc(100vh - 62px);
        background: var(--tc-white); flex-direction: column; padding: 32px 24px; gap: 20px;
        overflow-y: auto; z-index: 49; align-items: flex-start;
    }
    .tc-nav-links.is-open { display: flex; }
    .tc-nav-burger {
        display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
        background: none; border: none; cursor: pointer; color: var(--tc-navy); padding: 0; flex: none;
    }
    /* El color se fija de forma explícita (no solo heredado) porque un botón sin
       estilos propios puede tomar el color por defecto del user-agent del
       navegador, que varía de un dispositivo a otro — con eso, el ícono podía
       terminar casi invisible en algunos navegadores/sistemas en vez de tomar
       el azul marino de la marca. */
    .tc-burger-icon-close { display: none; }
    .tc-nav-burger.is-open .tc-burger-icon-lines { display: none; }
    .tc-nav-burger.is-open .tc-burger-icon-close { display: block; }
}

/* --- Hero --- */
.tc-hero { padding: 56px 24px 28px; background: var(--tc-paper); overflow: hidden; }
.tc-hero-inner { max-width: var(--tc-max); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.tc-eyebrow {
    font-family: var(--tc-font-mono); font-size: 0.82rem; letter-spacing: 0.07em; text-transform: uppercase;
    color: #1d706c; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.tc-eyebrow::before { content: ''; width: 18px; height: 2px; background: currentColor; display: inline-block; border-radius: 2px; }
.tc-hero h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); }
.tc-hero-lead { font-size: 1.1rem; max-width: 46ch; }
.tc-hero-cta { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.tc-hero-badges { display: flex; gap: 18px; margin-top: 34px; flex-wrap: wrap; }
.tc-hero-badge { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--tc-ink-soft); }
.tc-hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tc-mint); }

@media (max-width: 900px) {
    .tc-hero-inner { grid-template-columns: 1fr; }
}

/* --- Anillo orbital (elemento firma) --- */
/* Reconstruido como SVG estático (viewBox fijo 460x460): las posiciones de
   los 11 módulos se calculan una sola vez al generar el archivo, no en
   tiempo de ejecución con JavaScript. Esto es intencional — la versión
   anterior calculaba la posición de cada nodo con JS después de cargar la
   página, y si el contenedor todavía no tenía su tamaño final resuelto en
   ese momento (conexión lenta, impresión a PDF, ciertos navegadores), todos
   los nodos colapsaban en el mismo punto. Un SVG con coordenadas fijas en
   su propio viewBox no tiene ese problema: escala completo o no se muestra,
   nunca a medias. */
.tc-orbit-wrap { max-width: 460px; margin: 0 auto; }
.tc-orbit-svg { width: 100%; height: auto; display: block; }
.tc-orbit-node { cursor: default; transition: opacity 0.15s ease; }
.tc-orbit-node:hover, .tc-orbit-node:focus-visible { opacity: 0.85; outline: none; }
.tc-orbit-label {
    fill: white; font-family: var(--tc-font-body); font-weight: 600;
    font-size: 10.5px; pointer-events: none;
}
@media (max-width: 900px) {
    .tc-orbit-wrap { max-width: 340px; }
}

/* --- Secciones genéricas --- */
.tc-section { padding: 44px 24px; }
.tc-section-alt { background: var(--tc-paper-alt); }
.tc-section-navy { background: var(--tc-navy); color: var(--tc-white); }
.tc-section-navy h2, .tc-section-navy h3 { color: var(--tc-white); }
.tc-section-navy p { color: rgba(255,255,255,0.72); }
.tc-section-head { max-width: 640px; margin: 0 auto 28px; text-align: center; }
.tc-section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

/* --- Qué es / cómo funciona (proceso real, 3 pasos reales) --- */
.tc-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; max-width: var(--tc-max); margin: 0 auto; }
.tc-flow-step { background: var(--tc-white); border: 1px solid var(--tc-line); border-radius: var(--tc-radius); padding: 28px; }
.tc-flow-step .tc-flow-tag { font-family: var(--tc-font-mono); font-size: 0.78rem; color: var(--tc-teal); font-weight: 500; }
.tc-flow-step h3 { margin-top: 10px; font-size: 1.15rem; }
@media (max-width: 860px) { .tc-flow { grid-template-columns: 1fr; } }

/* --- Arquitectura (capas) --- */
.tc-stack { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 2px; }
.tc-stack-layer {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
    border-radius: var(--tc-radius-sm); padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.tc-stack-layer strong { font-family: var(--tc-font-display); }
.tc-stack-layer span.tc-stack-tech { font-family: var(--tc-font-mono); font-size: 0.8rem; color: var(--tc-mint); }

/* --- Grid de módulos --- */
.tc-modules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; max-width: var(--tc-max); margin: 0 auto; }
.tc-module-card { background: var(--tc-white); border: 1px solid var(--tc-line); border-radius: var(--tc-radius); padding: 22px; }
.tc-module-icon {
    width: 40px; height: 40px; padding: 9px; box-sizing: border-box; border-radius: 12px;
    background: var(--tc-gradient); fill: none; stroke: white; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round; display: block; margin-bottom: 12px;
}
.tc-module-card .tc-module-count { font-family: var(--tc-font-mono); font-size: 0.75rem; color: var(--tc-teal); }
.tc-module-badge { font-family: var(--tc-font-mono); font-size: 0.68rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; float: right; }
.tc-module-badge-base { background: var(--tc-mint-soft); color: #146c4f; }
.tc-module-badge-optional { background: var(--tc-paper-alt); color: var(--tc-ink-soft); border: 1px solid var(--tc-line); }
.tc-module-card h3 { font-size: 1.05rem; margin: 6px 0 8px; }
.tc-module-card p { font-size: 0.9rem; margin: 0; }

/* --- Seguridad (checklist tipo informe de auditoría) --- */
.tc-security-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; max-width: var(--tc-max); margin: 0 auto; }
.tc-security-item { display: flex; gap: 14px; background: var(--tc-white); border: 1px solid var(--tc-line); border-radius: var(--tc-radius); padding: 20px; }
.tc-security-item .tc-security-icon {
    flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--tc-mint-soft);
    display: flex; align-items: center; justify-content: center; color: var(--tc-teal);
}
.tc-security-item h4 { margin: 0 0 4px; font-size: 1rem; color: var(--tc-navy); }
.tc-security-item p { margin: 0; font-size: 0.88rem; }
.tc-security-level {
    display: inline-block; margin-top: 8px; font-family: var(--tc-font-mono); font-size: 0.7rem;
    padding: 2px 8px; border-radius: 4px; background: var(--tc-navy); color: var(--tc-mint);
}

/* --- Perfiles de usuario --- */
.tc-profiles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; max-width: var(--tc-max); margin: 0 auto; }
.tc-profile-chip { background: var(--tc-white); border: 1px solid var(--tc-line); border-radius: var(--tc-radius-sm); padding: 16px; text-align: center; }
.tc-profile-chip .tc-profile-icon { font-size: 1.4rem; }
.tc-profile-chip strong { display: block; margin-top: 8px; font-size: 0.9rem; color: var(--tc-navy); }
.tc-profile-chip-custom { background: transparent; border: 1.5px dashed var(--tc-teal); }
.tc-profile-chip-custom strong { color: var(--tc-teal); margin-top: 0; }

/* --- CTA final --- */
.tc-cta { text-align: center; max-width: 640px; margin: 0 auto; }
.tc-cta .tc-btn { margin-top: 22px; }

/* --- Formulario de contacto público --- */
.tc-contact-form {
    max-width: 620px; margin: 36px auto 0; background: var(--tc-white);
    border: 1px solid var(--tc-line); border-radius: var(--tc-radius); padding: 28px;
    display: flex; flex-direction: column; gap: 4px;
}
.tc-contact-form label { font-size: 0.85rem; font-weight: 600; color: var(--tc-navy); margin-top: 14px; display: block; }
.tc-contact-form input, .tc-contact-form textarea {
    width: 100%; padding: 10px 14px; border: 1px solid var(--tc-line); border-radius: var(--tc-radius-sm);
    font-family: var(--tc-font-body); font-size: 0.92rem; margin-top: 4px;
}
.tc-contact-form .tc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .tc-contact-form .tc-grid-2 { grid-template-columns: 1fr; } }
.tc-contact-form button { margin-top: 20px; }
.tc-contact-status { margin-top: 12px; font-size: 0.88rem; min-height: 1.2em; }
.tc-contact-status.is-ok { color: #146c4f; }
.tc-contact-status.is-error { color: #a3271b; }

/* --- Footer --- */
.tc-footer { background: var(--tc-navy); color: rgba(255,255,255,0.65); padding: 56px 24px 28px; }
.tc-footer-grid {
    max-width: var(--tc-max); margin: 0 auto; display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 32px;
}
.tc-footer-brand { display: flex; align-items: center; gap: 10px; color: var(--tc-white); font-family: var(--tc-font-display); font-weight: 600; font-size: 1.05rem; }
.tc-footer-brand img { height: 28px; }
.tc-footer-tagline { margin: 14px 0 20px; font-size: 0.88rem; line-height: 1.6; max-width: 320px; }
.tc-footer-col h4 { color: var(--tc-white); font-family: var(--tc-font-display); font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 14px; }
.tc-footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tc-footer-col a, .tc-footer-col span { color: inherit; text-decoration: none; font-size: 0.88rem; }
.tc-footer-col a:hover { color: var(--tc-white); }
.tc-footer-bottom {
    max-width: var(--tc-max); margin: 40px auto 0; padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.8rem;
}
@media (max-width: 860px) {
    .tc-footer-grid { grid-template-columns: 1fr 1fr; row-gap: 32px; }
    .tc-footer-tagline { max-width: none; }
}
@media (max-width: 520px) {
    .tc-footer-grid { grid-template-columns: 1fr; }
}

/* --- Utilidades de revelado al hacer scroll --- */
/* El contenido es visible por defecto (opacity:1) — así, si JavaScript no
   llega a ejecutarse a tiempo (conexión lenta, impresión a PDF, JS
   bloqueado), la página nunca queda con secciones invisibles. El efecto de
   aparición es una mejora progresiva: solo se activa cuando main.js agrega
   la clase .tc-js-ready al <html> al cargar, y en ese caso sí arranca desde
   opacity:0 para animar la entrada al hacer scroll. */
.tc-reveal { opacity: 1; transform: none; }
html.tc-js-ready .tc-reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
html.tc-js-ready .tc-reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Red de seguridad final: al imprimir (o exportar a PDF), todo se muestra
   siempre, sin importar el estado de la animación — el scroll-reveal no
   tiene sentido en una hoja impresa y no debe poder ocultar contenido ahí. */
@media print {
    .tc-reveal { opacity: 1 !important; transform: none !important; }
}

/* --- Contenido legal (terminos.php, politica-datos.php) — el HTML viene
   de admin/legal_pages.php, ya saneado, se le da formato de lectura aquí. --- */
.tc-legal-content { margin-top: 24px; line-height: 1.7; color: var(--tc-ink); }
.tc-legal-content h2 { font-family: var(--tc-font-display); font-size: 1.25rem; color: var(--tc-navy); margin: 28px 0 10px; }
.tc-legal-content h2:first-child { margin-top: 0; }
.tc-legal-content h3 { font-size: 1.05rem; color: var(--tc-navy); margin: 20px 0 8px; }
.tc-legal-content p { margin: 0 0 14px; }
.tc-legal-content ul, .tc-legal-content ol { margin: 0 0 14px; padding-left: 22px; }
.tc-legal-content li { margin-bottom: 6px; }
.tc-legal-content a { color: var(--tc-blue); }
.tc-legal-content blockquote { border-left: 3px solid var(--tc-mint); padding-left: 14px; color: var(--tc-ink-soft); margin: 0 0 14px; }

/* --- Botón flotante de WhatsApp — solo se imprime si hay número
   configurado en admin/server_settings.php (ver tc_render_whatsapp_button
   e includes/functions.php). Verde de marca de WhatsApp a propósito, no
   los colores de Totalisys — para que se reconozca de inmediato como el
   ícono de WhatsApp, como espera cualquier visitante. --- */
.tc-whatsapp-float {
    position: fixed; bottom: 22px; right: 22px; z-index: 90;
    width: 56px; height: 56px; border-radius: 50%; background: #25D366;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25); transition: transform 0.15s ease;
}
.tc-whatsapp-float:hover { transform: scale(1.08); }
@media (max-width: 600px) {
    .tc-whatsapp-float { bottom: 16px; right: 16px; width: 50px; height: 50px; }
}

/* --- Fila de íconos de redes sociales en el pie de página — solo se
   imprime si al menos una red está activada con URL (ver
   tc_render_social_links en includes/functions.php). --- */
.tc-social-links { display: flex; gap: 12px; align-items: center; }
.tc-social-links a {
    width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.1);
    color: var(--tc-white); display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
}
.tc-social-links a:hover { background: rgba(255,255,255,0.22); transform: translateY(-2px); }
