/**
 * MANO A LA OBRA — SISTEMA DE DISEÑO UNIFICADO (ESTILO FACEBOOK)
 * Variables globales y paleta profesional
 */

:root {
    /* Tipografías oficiales con fallback robusto */
    --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Paleta Oficial — WCAG AA Cumplido (Ratios >= 4.5:1 para texto normal y >= 3:1 para grande) */
    --azul-principal: #0866FF;
    --azul-hover: #0052D4;
    --azul-oscuro: #0A1629;
    --azul-suave: #E7F3FF;
    --fondo: #F0F2F5;
    --tarjeta: #FFFFFF;
    
    /* Textos con Alto Contraste */
    --texto: #0F172A;          /* 14.8:1 sobre blanco */
    --texto-suave: #475569;    /* 7.0:1 sobre blanco (excede WCAG AA) */
    --texto-claro: #F8FAFC;    /* Para fondos oscuros */
    --texto-claro-suave: #94A3B8; /* 5.8:1 sobre #0A1629 (excede WCAG AA) */

    --borde: #CBD5E1;
    --borde-suave: #E2E8F0;
    --exito: #16A34A;
    --exito-suave: #DCFCE7;
    --alerta: #DC2626;
    --alerta-suave: #FEE2E2;
    --aviso: #D97706;
    --aviso-suave: #FEF3C7;

    /* Aliases para compatibilidad retroactiva */
    --primary: var(--azul-principal);
    --primary-dark: var(--azul-hover);
    --primary-light: var(--azul-suave);
    --accent: var(--aviso);
    --accent-light: var(--aviso-suave);
    --dark: var(--azul-oscuro);
    --dark-surface: #1E293B;
    --text-main: var(--texto);
    --text-muted: var(--texto-suave);
    --text-dim: #64748B;
    --bg-main: var(--fondo);
    --surface: var(--tarjeta);
    --border: var(--borde);
    --border-light: var(--borde-suave);
    --success: var(--exito);
    --success-light: var(--exito-suave);
    --danger: var(--alerta);
    --danger-light: var(--alerta-suave);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 9999px;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 30px rgba(8, 102, 255, 0.12);
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--fondo);
    color: var(--texto);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 70px; /* Espacio para barra de navegación móvil */
}

@media (min-width: 992px) {
    body {
        padding-bottom: 0;
    }
}

h1, h2, h3, h4, h5, .brand-font {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* ===== ACCESIBILIDAD Y FOCO (NIELSEN: PREVENCIÓN DE ERRORES) ===== */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ===== BOTONES COHERENTES ===== */
.btn-brand {
    background-color: var(--primary);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(8, 102, 255, 0.25);
    transition: var(--transition);
    touch-action: manipulation;
}

.btn-brand:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(8, 102, 255, 0.35);
}

.btn-brand-outline {
    background-color: transparent;
    color: var(--primary) !important;
    font-weight: 700;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-brand-outline:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.btn-whatsapp {
    background: #25D366;
    color: #ffffff !important;
    font-weight: 700;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.3);
    transition: var(--transition);
}

.btn-whatsapp:hover {
    background: #1eb855;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
}

.btn-accent {
    background: var(--accent);
    color: var(--dark) !important;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
    transition: var(--transition);
}

.btn-accent:hover {
    background: #d97706;
    color: #fff !important;
    transform: translateY(-2px);
}

/* ===== BADGES DE ESTADO (NIELSEN: VISIBILIDAD DEL ESTADO) ===== */
.badge-verified {
    background-color: #dbeafe;
    color: var(--primary);
    border: 1px solid #bfdbfe;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-pending {
    background-color: var(--accent-light);
    color: #b45309;
    border: 1px solid #fde68a;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-category {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
}

/* ===== TARJETAS Y CONTENEDORES ===== */
.app-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.app-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

/* ===== NAVEGACIÓN SUPERIOR (DESKTOP Y TABLET) ===== */
.navbar-app {
    background: var(--dark);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #FFFFFF;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    text-decoration: none;
}

.nav-brand-logo:hover {
    color: #FFFFFF;
    opacity: 0.95;
}

.nav-brand-logo img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
}

/* Enlaces del menú central: white-space: nowrap para evitar partición */
.nav-desktop-links {
    flex-wrap: nowrap;
}

.nav-link-custom {
    color: #E2E8F0;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 7px 11px;
    border-radius: var(--radius-pill);
    transition: var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.nav-link-custom:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.12);
}

.nav-link-custom.active {
    color: #FFFFFF;
    background: rgba(8, 102, 255, 0.35);
    box-shadow: inset 0 0 0 1px rgba(8, 102, 255, 0.6);
}

/* Botones Ingresar y Registrarme claramente diferenciados */
.btn-nav-login {
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 6px 14px;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn-nav-login:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.45);
    color: #FFFFFF !important;
}

.btn-nav-register {
    color: #FFFFFF !important;
    background: var(--azul-principal);
    border: 1px solid var(--azul-principal);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 16px;
    box-shadow: 0 2px 8px rgba(8, 102, 255, 0.35);
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn-nav-register:hover {
    background: var(--azul-hover);
    border-color: var(--azul-hover);
    box-shadow: 0 4px 14px rgba(8, 102, 255, 0.45);
    color: #FFFFFF !important;
}

/* ===== BARRA DE NAVEGACIÓN INFERIOR (MÓVIL / PWA) ===== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1040;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 992px) {
    .mobile-bottom-nav {
        display: none;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    flex: 1;
    height: 100%;
    transition: var(--transition);
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-item.active i {
    transform: translateY(-2px);
}

/* ===== SISTEMA DE ESTRELLAS ===== */
.star-rating-display {
    color: var(--accent);
    display: inline-flex;
    gap: 3px;
    font-size: 0.95rem;
}

/* ===== TOAST NOTIFICACIONES (FEEDBACK AL USUARIO) ===== */
.app-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}

.app-toast {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: toastSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 5px solid var(--primary);
}

.app-toast.success { border-left-color: var(--success); }
.app-toast.danger { border-left-color: var(--danger); }
.app-toast.warning { border-left-color: var(--accent); }

@keyframes toastSlide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==============================================================
   MENÚ HAMBURGUESA MÓVIL FLUIDO, ACCESIBLE Y MICRO-ANIMADO
   ============================================================== */
.btn-hamburger {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    transition: var(--transition);
}

.btn-hamburger:hover, .btn-hamburger:focus {
    background: rgba(255, 255, 255, 0.12);
}

.btn-hamburger .bar {
    width: 22px;
    height: 2.2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    transform-origin: center;
}

/* Estado activo del botón hamburguesa (transformación a X) */
.btn-hamburger.active .bar:nth-child(1) {
    transform: translateY(7.2px) rotate(45deg);
}
.btn-hamburger.active .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.btn-hamburger.active .bar:nth-child(3) {
    transform: translateY(-7.2px) rotate(-45deg);
}

/* Cajón Lateral Móvil (Offcanvas Drawer Moderno, Fluido y Blindado) */
.offcanvas,
.mobile-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 320px !important;
    max-width: 86vw !important;
    height: 100vh !important;
    background: #0A1629 !important;
    color: #ffffff !important;
    z-index: 1095 !important;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(105%) !important;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s ease !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    will-change: transform;
    visibility: hidden !important;
}

.offcanvas.show,
.mobile-drawer.open {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.offcanvas:not(.show):not(.showing) {
    transform: translateX(105%) !important;
    visibility: hidden !important;
}

.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 41, 0.72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1080;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-body,
.offcanvas-body {
    padding: 20px 16px;
    flex: 1;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px;
    background: #0A1629 !important;
    color: #ffffff !important;
}

.offcanvas-header {
    background: #0A1629 !important;
    color: #ffffff !important;
}

.drawer-nav-link {
    display: flex !important;
    width: 100% !important;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: #cbd5e1;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
}

.drawer-nav-link:hover, .drawer-nav-link.active {
    background: rgba(8, 102, 255, 0.15);
    color: #60a5fa;
    transform: translateX(4px);
}

.drawer-nav-link i {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
}

/* ==============================================================
   DISEÑO ESTILO RED SOCIAL DE TRABAJO (FEED & POSTS)
   ============================================================== */
.social-feed-container {
    max-width: 680px;
    margin: 0 auto;
}

.social-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    margin-bottom: 24px;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.social-card:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.social-card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
}

.social-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.social-media-wrap {
    background: #000;
    position: relative;
    overflow: hidden;
    max-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-media-wrap img,
.portafolio-img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.2s ease;
}

.social-media-wrap:hover img,
.portafolio-img:hover {
    transform: scale(1.02);
    filter: brightness(0.97);
}

.social-actions-bar {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    background: #ffffff;
}

.social-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.social-action-btn:hover {
    background: var(--border-light);
    color: var(--primary);
}

.social-action-btn.liked {
    color: var(--primary);
    font-weight: 700;
}

.social-action-btn.liked i {
    animation: heartPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.social-comments-section {
    padding: 16px 20px;
    background: #fafbfc;
    border-top: 1px solid var(--border-light);
}

.comment-bubble {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* ==============================================================
   PORTADA DE PERFIL CON CÁMARA OVERLAY & OPTIMIZACIÓN
   ============================================================== */
.profile-cover-container {
    position: relative;
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #0A1629 0%, #162A45 100%);
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
    .profile-cover-container {
        height: 280px;
    }
}

.profile-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.btn-cover-action {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(10, 22, 41, 0.8);
    backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-cover-action:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* ==============================================================
   CURSOS & CAPACITACIONES (VISTA PREVIA DE CERTIFICADO)
   ============================================================== */
.course-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(8, 102, 255, 0.12);
    border-color: #93c5fd;
}

.course-cover {
    height: 180px;
    background: #0f172a;
    position: relative;
    overflow: hidden;
}

.course-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.certificate-preview-box {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: var(--transition);
}

.certificate-preview-box:hover {
    border-color: var(--primary);
    background: #eff6ff;
    transform: scale(1.01);
}

/* Micro-animaciones generales */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}


/* ============================================================
   CURSOS — Filtros de Categoría & Hero
   ============================================================ */
.filter-pills-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}
.filter-pills-scroll::-webkit-scrollbar { display: none; }

.filter-pill {
    flex-shrink: 0;
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
    border: 1.5px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.filter-pill:hover,
.filter-pill.active {
    background: var(--color-brand);
    color: #fff;
    border-color: var(--color-brand);
}

/* Badge parpadeante NUEVO */
@keyframes badgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.07); }
}
.badge-pulse {
    animation: badgePulse 1.8s ease-in-out infinite;
}

/* Curso — badge de modalidad superpuesto */
.course-modality-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    backdrop-filter: blur(4px);
}
.badge-online { background: rgba(37,99,235,0.88); color:#fff; }
.badge-presencial { background: rgba(16,185,129,0.88); color:#fff; }
.badge-hibrido { background: rgba(234,88,12,0.88); color:#fff; }

/* Curso — badge DESTACADO dorado */
.badge-featured {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(245,158,11,0.4);
}

/* Cursos hero */
.cursos-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0866ff22 100%);
    padding: 4rem 0 3rem;
}

/* ============================================================
   GUÍAS — Accordion personalizado
   ============================================================ */
.guia-section-header {
    border-radius: 12px !important;
    font-weight: 700;
}
.guia-accordion .accordion-button:not(.collapsed) {
    background: var(--color-brand);
    color: #fff;
    box-shadow: none;
}
.guia-accordion .accordion-button:not(.collapsed)::after {
    filter: brightness(10);
}
.guia-accordion .accordion-button {
    font-weight: 600;
    font-size: 0.95rem;
}
.guia-accordion .accordion-body {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ============================================================
   ADMIN PANEL — Tabs extras & Toasts
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.admin-action-btn {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.admin-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* ============================================================
   PERFIL TRABAJADOR — portada responsive
   ============================================================ */
.profile-cover-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a5f 0%, #0866ff 100%);
}
@media (max-width: 576px) {
    .profile-cover-container { height: 150px; }
}
.profile-cover-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.btn-cover-action {
    opacity: 0.92;
    backdrop-filter: blur(4px);
    transition: opacity 0.2s ease;
}
.btn-cover-action:hover { opacity: 1; }

/* ============================================================
   NOTIFICACIONES — plantillas rápidas
   ============================================================ */
.plantilla-btn {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.plantilla-btn:hover {
    border-color: var(--color-brand);
    background: rgba(8,102,255,0.04);
}


/* ==============================================================
   RED SOCIAL "MANO A LA OBRA" (ESTILO FACEBOOK PROFESIONAL)
   Paleta: Sobria, Corporativa, Azul Profesional #0866FF y #0F172A
   ============================================================== */

/* Layout general de Red Social de Trabajo */
.feed-social-layout {
    background: #F0F2F5;
    min-height: 100vh;
}

/* Sidebar estilo Facebook con accesos directos y widgets */
.fb-sidebar-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E4E6EB;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 16px;
    margin-bottom: 16px;
}

.fb-shortcut-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #050505;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background 0.18s ease;
}

.fb-shortcut-item:hover {
    background: #E4E6EB;
    color: #0866FF;
}

.fb-shortcut-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Historias / Obras Destacadas estilo Facebook Stories */
.fb-stories-wrapper {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.fb-stories-wrapper::-webkit-scrollbar { display: none; }

.fb-story-card {
    position: relative;
    width: 125px;
    height: 195px;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
    background: #1e293b;
    border: 1px solid rgba(0,0,0,0.08);
}

.fb-story-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 18px rgba(8,102,255,0.22);
}

.fb-story-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.fb-story-card:hover .fb-story-img {
    transform: scale(1.06);
}

.fb-story-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.85) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
}

.fb-story-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid #0866FF;
    object-fit: cover;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.fb-story-name {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tarjeta "Crear Publicación / Solicitar Presupuesto" estilo Facebook */
.fb-create-post-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E4E6EB;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 16px;
    margin-bottom: 18px;
}

.fb-create-input-box {
    background: #F0F2F5;
    border-radius: 24px;
    padding: 12px 18px;
    color: #65676B;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.18s ease;
    border: 1px solid transparent;
}

.fb-create-input-box:hover {
    background: #E4E6EB;
}

.fb-quick-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #65676B;
    font-weight: 600;
    font-size: 0.88rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.18s ease;
    flex: 1;
}

.fb-quick-action-btn:hover {
    background: #F0F2F5;
}

/* Tarjetas de Profesionales estilo Red Social (Worker Card) */
.worker-social-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E4E6EB;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.worker-social-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.worker-card-banner {
    height: 90px;
    background: linear-gradient(135deg, #1e3a5f 0%, #0866FF 100%);
    position: relative;
}

.worker-card-avatar-wrap {
    position: relative;
    margin-top: -45px;
    padding: 0 16px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.worker-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    background: #ffffff;
}

.worker-card-body {
    padding: 12px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Post Card Social (Feed Principal) */
.fb-post-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E4E6EB;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-bottom: 18px;
    overflow: hidden;
}

.fb-post-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fb-post-content {
    padding: 0 16px 12px;
    font-size: 0.95rem;
    color: #050505;
    line-height: 1.5;
}

.fb-post-media {
    width: 100%;
    max-height: 520px;
    background: #000000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-post-media img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
}

.fb-post-stats {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #CED0D4;
    color: #65676B;
    font-size: 0.85rem;
}

.fb-post-actions {
    display: flex;
    padding: 4px 12px;
}

.fb-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    border: none;
    background: transparent;
    color: #65676B;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.fb-action-btn:hover {
    background: #F0F2F5;
    color: #050505;
}

.fb-action-btn.liked {
    color: #0866FF;
}

/* Badge Verificado de Confianza estilo Red Social */
.fb-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #E7F3FF;
    color: #0866FF;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

/* ========================================================
   FASE 3 & 4: COMPONENTES ESTILO FACEBOOK & INDEX MINIMALISTA
   ======================================================== */

/* Hero Minimalista */
.hero-minimal {
    background: linear-gradient(180deg, #FFFFFF 0%, var(--fondo) 100%);
    padding: 48px 16px 36px;
    border-bottom: 1px solid var(--borde);
    text-align: center;
}

.hero-title {
    color: var(--azul-oscuro);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.hero-subtitle {
    color: var(--texto-suave);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    max-width: 540px;
    margin: 0 auto 24px;
    line-height: 1.5;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-facebook-primary {
    background-color: var(--azul-principal);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(8, 102, 255, 0.2);
}

.btn-facebook-primary:hover {
    background-color: #0052CC;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(8, 102, 255, 0.3);
}

.btn-facebook-secondary {
    background-color: #E4E6EB;
    color: var(--texto) !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid var(--borde);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-facebook-secondary:hover {
    background-color: #D8DADF;
    transform: translateY(-1px);
}

/* Sección ¿De qué trata? */
.section-intro-card {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

/* Tarjetas de Oficios (Profesionales que necesitamos) */
.trade-card {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.trade-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(8, 102, 255, 0.12);
    border-color: var(--azul-principal);
}

.trade-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #E7F3FF;
    color: var(--azul-principal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 12px;
    transition: transform 0.25s ease, background 0.25s ease;
}

.trade-card:hover .trade-icon-wrapper {
    transform: scale(1.1);
    background: var(--azul-principal);
    color: #FFFFFF;
}

.trade-name {
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--texto);
    margin-bottom: 4px;
}

.trade-action-hint {
    font-size: 0.78rem;
    color: var(--azul-principal);
    font-weight: 600;
}

/* Línea de Nodos Conectados (Timeline Animada de ¿Cómo funciona?) */
.timeline-section-title {
    text-align: center;
    font-weight: 800;
    color: var(--azul-oscuro);
    margin-bottom: 8px;
}

.timeline-flow-wrapper {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    border-radius: var(--radius);
    padding: 28px 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.flow-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 50px;
    margin-bottom: 20px;
}

.flow-badge-pro {
    background: #E7F3FF;
    color: var(--azul-principal);
}

.flow-badge-cli {
    background: #E7F8ED;
    color: var(--exito);
}

.timeline-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    gap: 12px;
}

/* Línea conectora entre nodos */
.timeline-track-line {
    position: absolute;
    top: 24px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: var(--borde);
    z-index: 1;
}

.timeline-track-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--azul-principal) 0%, #31A24C 100%);
    animation: drawLine 2s ease-in-out infinite alternate;
}

.timeline-node {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
}

.timeline-node-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 3px solid var(--azul-principal);
    color: var(--azul-principal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.timeline-node:hover .timeline-node-circle {
    transform: scale(1.15);
    background: var(--azul-principal);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(8, 102, 255, 0.3);
}

.timeline-node-cli .timeline-node-circle {
    border-color: var(--exito);
    color: var(--exito);
}

.timeline-node-cli:hover .timeline-node-circle {
    background: var(--exito);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(49, 162, 76, 0.3);
}

.timeline-node-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--texto);
    line-height: 1.25;
    margin-bottom: 2px;
}

.timeline-node-desc {
    font-size: 0.72rem;
    color: var(--texto-suave);
    display: none;
}

@media (min-width: 576px) {
    .timeline-node-desc {
        display: block;
    }
}

/* Responsive mobile de Alta Calidad para el timeline de Pasos */
@media (max-width: 575px) {
    .timeline-steps {
        display: flex;
        flex-direction: column;
        gap: 10px;
        position: relative;
    }
    .timeline-track-line {
        display: none; /* Ocultar línea horizontal en móvil para dar paso a tarjetas táctiles limpias */
    }
    .timeline-node {
        display: flex;
        flex-direction: row;
        align-items: center;
        background: #FFFFFF;
        border: 1px solid var(--borde);
        border-radius: 10px;
        padding: 12px 14px;
        text-align: left;
        width: 100%;
        gap: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04);
        transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
    }
    .timeline-node:active,
    .timeline-node:hover {
        transform: scale(0.99);
        border-color: var(--azul-principal);
        background-color: #F8FAFC;
    }
    .timeline-node-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin-bottom: 0;
        flex-shrink: 0;
        border-width: 2px;
    }
    .timeline-node-content {
        flex: 1;
    }
    .timeline-node-title {
        font-size: 0.9rem;
        font-weight: 700;
        margin-bottom: 1px;
    }
    .timeline-node-desc {
        display: block;
        font-size: 0.75rem;
        color: var(--texto-suave);
    }
    .timeline-node-chevron {
        color: #94A3B8;
        font-size: 0.85rem;
        margin-left: auto;
    }
}

/* Botones de Acción del Perfil (Animación y Estilo) */
.profile-actions-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.profile-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-decoration: none !important;
}

.profile-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.profile-action-btn:active {
    transform: translateY(0);
}

/* ANIMACIONES LIGERAS */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes drawLine {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

.anim-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.anim-slide-up {
    animation: slideUp 0.5s ease-out forwards;
}

/* Modales con transición limpia */
.modal.fade .modal-dialog {
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* RESPETO A PREFERS-REDUCED-MOTION */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .timeline-track-line::after {
        animation: none;
    }
    .trade-card:hover,
    .timeline-node:hover .timeline-node-circle {
        transform: none !important;
    }
}

/* ==============================================================
   MEJORAS GLOBALES DE ACCESIBILIDAD Y CONTRASTE WCAG AA (>= 4.5:1)
   ============================================================== */

/* 1. Corrección de contraste en Footer y Áreas Oscuras */
footer,
.navbar-app,
.offcanvas-body {
    color: var(--texto-claro);
}

footer .text-secondary,
footer .text-muted,
.navbar-app .text-secondary,
.navbar-app .text-muted,
.offcanvas-body .text-secondary,
.offcanvas-body .text-muted {
    color: var(--texto-claro-suave) !important; /* #94A3B8: ratio 5.8:1 sobre fondos oscuros */
}

footer a.text-secondary:hover,
footer a.text-muted:hover,
.offcanvas-body a.text-secondary:hover {
    color: #FFFFFF !important;
}

/* 2. Corrección de contraste en Badges */
.badge.bg-light.text-muted,
.badge.bg-light.text-secondary {
    background-color: #E2E8F0 !important;
    color: #1E293B !important; /* Ratio 9.8:1 */
    border: 1px solid #CBD5E1;
}

.badge.bg-light.text-primary {
    background-color: #E7F3FF !important;
    color: #0866FF !important; /* Ratio 5.5:1 */
    border: 1px solid rgba(8, 102, 255, 0.2);
}

/* 3. Placeholders accesibles (WCAG AA) */
::placeholder {
    color: #64748B !important; /* Ratio 4.6:1 sobre blanco */
    opacity: 1 !important;
}
:-ms-input-placeholder {
    color: #64748B !important;
}
::-ms-input-placeholder {
    color: #64748B !important;
}

/* 4. Foco accesible de alto contraste (Outline visible) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--azul-principal) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(8, 102, 255, 0.25) !important;
}

/* 5. Sombras suaves y bordes redondeados armonizados */
.app-card {
    border-radius: var(--radius);
    border: 1px solid var(--borde-suave);
    background: var(--surface);
}

.btn-brand:hover {
    background-color: var(--azul-hover);
    color: #FFFFFF !important;
    box-shadow: 0 4px 14px rgba(8, 102, 255, 0.35);
}

.btn-brand:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
