:root {
    /* Usar variables globales donde sea posible, definir específicas solo si es necesario */
    --font-main: var(--font-body);

    /* Adaptación al Tema Oscuro LABIAS */
    --color-bg: var(--bg-dark);
    /* Antes #f8f9fc */
    --color-text: var(--text-light);
    /* Antes #1a1a2e */
    --color-text-light: var(--text-dim);
    /* Antes #4a4a6a */

    /* Gradientes refinados para modo oscuro */
    --primary-gradient: linear-gradient(135deg, var(--primary) 0%, #d946ef 100%);
    --secondary-gradient: linear-gradient(135deg, var(--secondary) 0%, #3b82f6 100%);
    --accent-gradient: linear-gradient(135deg, var(--action) 0%, var(--primary) 100%);

    --color-primary: var(--primary);
    --color-secondary: var(--secondary);
    --color-surface: rgba(255, 255, 255, 0.05);
    /* Glass effect base */
    --color-surface-hover: rgba(255, 255, 255, 0.08);

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);

    --radius-md: var(--radius-md);
    --radius-lg: 2rem;

    /* Ensure header height matches global style */
    --header-height: 90px;

    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Force Header consistency */
body>header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Utilities - Redefiniciones para compatibilidad */
/* .container ya está en styles.css, pero aseguramos overrides si existen */

.hidden {
    display: none !important;
}

/* Botones adaptados al sistema LDS */
.btn-primary {
    background: var(--primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(255, 117, 160, 0.3);
    border: none;
}

.btn-primary:hover {
    box-shadow: 0 0 35px rgba(255, 117, 160, 0.6);
    transform: translateY(-2px);
    opacity: 1;
    color: var(--bg-dark);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.05);
}

.btn-secondary:hover {
    background: rgba(0, 245, 212, 0.08);
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.2);
    border-color: var(--secondary);
    color: var(--secondary);
}

/* Hero */
.hero-section {
    padding: calc(var(--header-height) + 4rem) 0 4rem;
    /* Ajuste para navbar fija */
    text-align: center;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(236, 72, 153, 0.1) 0%, transparent 40%);
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--secondary), var(--action));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-note {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-bottom: 2rem;
    font-weight: 600;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Macro Grid (Panel Superior - Rediseñado estilo Strategic Map) */
.macro-nav {
    padding-bottom: 2rem;
}

.macro-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

@media (min-width: 900px) {
    .macro-grid {
        grid-template-columns: repeat(3, 1fr);
        align-items: stretch;
    }
}

.macro-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Borde sutil */
    border-top: 4px solid var(--card-color, var(--color-primary));
    /* Color dinámico si se inyecta, fallback primary */
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Colores específicos para cada tarjeta (simulado con nth-child para no tocar HTML si es posible, o ajustaremos JS después) 
   Asumimos orden: 1. Chat, 2. Proyecto, 3. Factoría
*/
.macro-card:nth-child(1) {
    --card-color: #FF75A0;
    --card-glow: rgba(255, 117, 160, 0.4);
}

.macro-card:nth-child(2) {
    --card-color: #00F5D4;
    --card-glow: rgba(0, 245, 212, 0.4);
}

.macro-card:nth-child(3) {
    --card-color: #6366F1;
    --card-glow: rgba(99, 102, 241, 0.4);
}

.macro-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px -5px var(--card-glow);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
    margin-bottom: 1rem;
    width: 100%;
}

.macro-card h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.macro-tagline {
    font-size: 0.95rem;
    color: var(--card-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.macro-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.keyword-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.macro-footer {
    margin-top: auto;
    width: 100%;
}

.macro-footer .btn-secondary {
    width: 100%;
    border-color: var(--card-color);
    color: var(--card-color);
    opacity: 0.8;
}

.macro-footer .btn-secondary:hover {
    background: var(--card-color);
    color: var(--bg-dark);
    /* Asumiendo fondo oscuro global */
    box-shadow: 0 0 15px var(--card-glow);
    opacity: 1;
}

/* Detail Sections */
.macro-detail {
    background: rgba(30, 41, 59, 0.4);
    /* Darker glass */
    backdrop-filter: blur(12px);
    margin: 2rem auto;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    scroll-margin-top: 100px;
    /* header offset */
    opacity: 0.8;
    transition: opacity 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-light);
}

.macro-detail.active-highlight {
    opacity: 1;
    box-shadow: 0 0 0 1px var(--primary), 0 0 30px rgba(255, 117, 160, 0.15);
    border-color: var(--primary);
}

.detail-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.detail-header h2 {
    font-size: 2.5rem;
    color: var(--primary);
    text-shadow: 0 0 15px rgba(255, 117, 160, 0.3);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.info-block h4 {
    margin-bottom: 1rem;
    color: var(--text-light);
    font-size: 1.2rem;
    border-left: 3px solid var(--secondary);
    padding-left: 0.75rem;
}

.info-block ul {
    list-style: none;
    padding-left: 0;
}

.info-block li {
    margin-bottom: 0.7rem;
    padding-left: 1.25rem;
    position: relative;
    color: var(--text-dim);
}

.info-block li::before {
    content: "•";
    color: var(--secondary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Micro Scenarios Grid */
.micro-section-title {
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
    color: var(--text-light);
}

.micro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    /* Optimizado para centrado */
    gap: 1.5rem;
    justify-content: center;
    /* Centrar grid si hay huecos */
    max-width: 1000px;
    /* Limitar ancho para que no se esparzan demasiado */
    margin: 0 auto;
}

.micro-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.micro-card:hover {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    border-color: var(--secondary);
    transform: translateY(-3px);
}

.micro-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.micro-letter {
    width: 36px;
    height: 36px;
    background: var(--text-light);
    color: var(--bg-dark);
    border-radius: 8px;
    /* Square with radius looks more tech */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}

.micro-card h5 {
    font-size: 1.2rem;
    color: var(--text-light);
    margin: 0;
}

.micro-desc {
    font-size: 0.95rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    min-height: 40px;
}

.btn-mini {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mini:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(255, 117, 160, 0.1);
    box-shadow: 0 0 10px rgba(255, 117, 160, 0.2);
}

/* Test Section */
.test-section {
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.9), rgba(10, 10, 20, 0.95));
    border: 1px solid var(--border-light);
    color: white;
    border-radius: var(--radius-lg);
    margin: 4rem auto;
    padding: 3rem 1rem;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.test-card {
    max-width: 800px;
    margin: 0 auto;
}

.test-header {
    margin-bottom: 3rem;
    text-align: center;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.05);
    height: 4px;
    border-radius: 2px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.progress-fill {
    background: var(--secondary);
    box-shadow: 0 0 10px var(--secondary);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.question-step h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.option-label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.option-label.selected {
    background: rgba(99, 102, 241, 0.2);
    border-color: #818cf8;
}

.option-input {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    margin-right: 1rem;
    position: relative;
    flex-shrink: 0;
}

.option-input:checked {
    border-color: #818cf8;
    background: #818cf8;
}

.test-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.test-result {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: var(--radius-lg);
    animation: fadeIn 0.5s ease;
}

.result-badge {
    display: inline-block;
    background: var(--accent-gradient);
    padding: 0.5rem 1.5rem;
    border-radius: 999px;
    font-weight: bold;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 17, 26, 0.9);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    background: var(--surface);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    position: relative;
    overflow-y: auto;
    padding: 3rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid var(--border-light);
}

.modal-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 2.5rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dim);
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
}

.modal-content h3 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1rem;
}

/* Responsiveness */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.25rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .modal-container {
        width: 100%;
        height: 75vh;
        max-height: 75vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        align-self: flex-end;
        /* Bottom sheet effect */
        margin-bottom: 0;
        padding: 2rem;
    }

    .hero-actions {
        flex-direction: column;
        padding: 0 2rem;
    }

    .macro-grid {
        padding: 0 1rem;
    }
}