﻿
:root {
    /* Fondos */
    --lm-bg-page: #c5e2d8;
    --lm-bg-topbar: #091d16;
    --lm-bg-surface: #f4f8f6;
    --lm-bg-card: #eef7f3;
    --lm-bg-info: #e6f4ee;
    --lm-bg-input: #dfece7;
    --lm-bg-box: rgba(255, 255, 255, 0.12);
    --lm-bg-white: #ffffff;
    /* Colores de marca y acento */
    --lm-brand-link: #1da876;
    --lm-brand-name: #21b882;
    --lm-primary: #0b5c46;
    --lm-primary-hover: #084736;
    --lm-primary-pill: #0a6c52;
    --lm-primary-soft: #9ec5b8;
    /* Textos */
    --lm-text-body: #162b25;
    --lm-text-dark: #132a23;
    --lm-text-soft: #15362c;
    --lm-text-back: #114b3a;
    --lm-text-muted: #2d5a4c;
    --lm-text-on-primary: #ffffff;
    /* Bordes y sombras */
    --lm-border-input: #8aa99e;
    --lm-border-panel: #b5d5ca;
    --lm-border-card: #a9cfc2;
    --lm-shadow-soft: 0 2px 6px rgba(10, 40, 30, 0.08);
    /* Estados (éxito, advertencia, error) */
    --lm-ok-bg: #d7f0e4;
    --lm-ok-text: #0b4a37;
    --lm-ok-border: #9fd3bb;
    --lm-warn-bg: #fdf3d0;
    --lm-warn-text: #7a5a00;
    --lm-warn-border: #ecd78a;
    --lm-err-bg: #fde8e8;
    --lm-err-text: #9b1c1c;
    --lm-err-border: #f8b4b4;
    /* Tipografías */
    --lm-font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --lm-font-brand: 'Brush Script MT', 'Segoe Script', cursive;
    --lm-font-mono: Consolas, 'Courier New', monospace;
}

/* =========================================================
   Estructura general y barra superior
   ========================================================= */
.linemath-page {
    min-height: 100vh;
    background-color: var(--lm-bg-page);
    color: var(--lm-text-body);
    font-family: var(--lm-font-sans);
}

.linemath-topbar {
    background-color: var(--lm-bg-topbar);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--lm-brand-link);
}

.brand-mark {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
}

.brand-name {
    font-family: var(--lm-font-brand);
    font-size: 1.75rem;
    color: var(--lm-brand-name);
}

.linemath-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 80px 24px 48px; /* deja espacio para la barra fija superior */
}

/* =========================================================
   Encabezado de cada método
   ========================================================= */
.title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.title-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    background: transparent;
    border: none;
    color: var(--lm-text-back);
    font-size: 2.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
}

.page-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--lm-text-dark);
}

.help-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--lm-text-muted);
    background: transparent;
    color: var(--lm-text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.solve-btn {
    background-color: var(--lm-primary);
    color: var(--lm-text-on-primary);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

    .solve-btn:hover {
        background-color: var(--lm-primary-hover);
    }

.info-banner {
    background-color: var(--lm-bg-info);
    border-left: 4px solid var(--lm-primary);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 0.92rem;
}

/* =========================================================
   Pasos, selector de variables y matrices
   ========================================================= */
.step-block {
    margin-bottom: 20px;
}

.step-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--lm-text-dark);
    margin-bottom: 12px;
}

.size-selector {
    display: flex;
    gap: 10px;
}

.size-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 5px;
    background-color: var(--lm-primary-soft);
    color: var(--lm-text-soft);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

    .size-btn.active {
        background-color: var(--lm-primary);
        color: var(--lm-text-on-primary);
    }

.system-workspace {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.matrix-box,
.vector-box {
    border: 2px solid var(--lm-primary);
    border-radius: 6px;
    padding: 14px 20px 20px;
    background-color: var(--lm-bg-box);
}

.vector-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.var-columns {
    display: grid;
    gap: 14px;
    margin-bottom: 10px;
    text-align: center;
}

.var-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--lm-text-dark);
    text-align: center;
}

.matrix-grid {
    display: grid;
    gap: 12px 14px;
}

.equals-sign {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--lm-text-dark);
}

.cell-input {
    width: 76px;
    height: 36px;
    background-color: var(--lm-bg-input);
    border: 1px solid var(--lm-border-input);
    border-radius: 7px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--lm-text-dark);
    outline: none;
}

    .cell-input:focus {
        border-color: var(--lm-primary);
        background-color: var(--lm-bg-white);
    }

/* =========================================================
   Resultados, alertas y procedimiento
   ========================================================= */
.result-section {
    margin-top: 24px;
}

.result-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--lm-primary);
    margin-bottom: 10px;
}

.result-bar {
    background-color: var(--lm-bg-surface);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: var(--lm-shadow-soft);
}

.result-pills {
    display: flex;
    align-items: center;
    background-color: var(--lm-primary-pill);
    color: var(--lm-text-on-primary);
    border-radius: 8px;
    padding: 8px 14px;
    gap: 12px;
    flex-wrap: wrap;
    font-weight: 600;
    font-size: 0.95rem;
}

.pill-divider {
    opacity: 0.55;
}

.procedure-toggle {
    background: transparent;
    border: none;
    color: var(--lm-primary);
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.chevron {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

    .chevron.open {
        transform: rotate(180deg);
    }

.ok-box,
.warn-box,
.error-box {
    margin-top: 12px;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.92rem;
    font-weight: 600;
}

.ok-box {
    background-color: var(--lm-ok-bg);
    color: var(--lm-ok-text);
    border: 1px solid var(--lm-ok-border);
}

.warn-box {
    background-color: var(--lm-warn-bg);
    color: var(--lm-warn-text);
    border: 1px solid var(--lm-warn-border);
}

.error-box {
    background-color: var(--lm-err-bg);
    color: var(--lm-err-text);
    border: 1px solid var(--lm-err-border);
}

.procedure-panel {
    margin-top: 12px;
    background-color: var(--lm-bg-surface);
    border-radius: 10px;
    padding: 16px 20px;
    border: 1px solid var(--lm-border-panel);
}

.step-line {
    margin: 0 0 10px;
    white-space: pre-wrap;
    font-family: var(--lm-font-mono);
    font-size: 0.88rem;
    color: var(--lm-text-dark);
}

    .step-line:last-child {
        margin-bottom: 0;
    }

/* =========================================================
   Portada (Inicio)
   ========================================================= */
.portada-wrapper {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
}

.portada-lines {
    position: absolute;
    pointer-events: none;
    user-select: none;
}

.portada-lines-tl {
    top: 0;
    left: 0;
    width: 240px;
    height: 240px;
}

.portada-lines-br {
    bottom: 0;
    right: 0;
    width: 280px;
    height: 300px;
}

.portada-center {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.lm-hero-mark {
    font-family: var(--lm-font-brand);
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 0.9;
    color: var(--lm-primary);
}

.lm-hero-title {
    font-family: var(--lm-font-brand);
    font-size: clamp(3.2rem, 6vw, 4.8rem);
    font-weight: 400;
    line-height: 1.05;
    color: var(--lm-text-dark);
    margin: 4px 0 26px;
}

.portada-btn {
    display: inline-block;
    text-decoration: none;
    padding: 11px 34px;
    border-radius: 9px;
    box-shadow: var(--lm-shadow-soft);
}

    .portada-btn:hover {
        color: var(--lm-text-on-primary);
    }

/* =========================================================
   Menú de métodos
   ========================================================= */
.menu-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 24px 48px;
}

.menu-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

    .menu-header .lm-hero-title {
        margin-bottom: 8px;
    }

.menu-subtitle {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--lm-primary);
}

.menu-carousel-shell {
    width: 100%;
    max-width: 960px;
}

.menu-carousel {
    display: flex;
    gap: 22px;
    overflow-x: auto;
    padding: 8px 6px 24px;
    scroll-snap-type: x proximity;
    scrollbar-color: var(--lm-bg-page) var(--lm-brand-link);
}

    .menu-carousel::-webkit-scrollbar {
        height: 11px;
    }

    .menu-carousel::-webkit-scrollbar-track {
        background: var(--lm-brand-link);
        border-radius: 999px;
    }

    .menu-carousel::-webkit-scrollbar-thumb {
        background: var(--lm-bg-page);
        border: 2px solid var(--lm-brand-link);
        border-radius: 999px;
    }

.method-card {
    flex: 0 0 265px;
    scroll-snap-align: start;
    background-color: var(--lm-bg-card);
    border: 1px solid var(--lm-border-card);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--lm-shadow-card);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

    .method-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(10, 40, 30, 0.12);
    }

.method-thumb {
    width: 100%;
    height: 175px;
    background-color: var(--lm-bg-page);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    margin-bottom: 16px;
}

    .method-thumb svg {
        width: 100%;
        height: 100%;
        max-width: 210px;
        max-height: 150px;
    }

.method-name {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--lm-text-dark);
    text-align: center;
}

.method-btn {
    display: inline-block;
    text-decoration: none;
    padding: 9px 26px;
    border-radius: 8px;
    font-size: 0.92rem;
}

    .method-btn:hover {
        color: var(--lm-text-on-primary);
    }