/* ============================================
   FACTORA - COMMON.CSS
   Estilos base, tipografía, grid, header, footer
   ============================================ */

:root {
    --red: #ff5045;
    --red-dark: #e03c32;
    --blue: #0b1e57;
    --blue-dark: #0d265c;
    --light: #f9fafc;
    --white: #ffffff;
    --gray: #4b5563;
    --border: #e0e5ed;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 16px 32px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--white);
    color: #1e293b;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 3.5rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 2.75rem; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 1.75rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }
.text-body { font-size: 1rem; }
.text-small { font-size: 0.9rem; }

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    .container { padding: 0 20px; }
}

/* ===== HEADER ===== */
header {
    background: var(--white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 32px;
    padding-right: 32px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo img {
    height: 32px;
    vertical-align: middle;
}
.logo span {
    color: var(--red);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    font-weight: 500;
    color: var(--blue);
}
.nav-links a {
    transition: color 0.2s;
}
.nav-links a:hover {
    color: var(--red);
}
.nav-links .btn-demo {
    background: var(--red);
    color: white;
    padding: 10px 24px;
    border-radius: 60px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: 0 8px 20px rgba(255, 80, 69, 0.25);
}
.nav-links .btn-demo:hover {
    background: var(--red-dark);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 28px rgba(255, 80, 69, 0.35);
}

.menu-toggle {
    display: none;
    font-size: 1.8rem;
    color: var(--blue);
    cursor: pointer;
}

@media (max-width: 1024px) {
    .menu-toggle { display: block; }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        padding: 24px 32px;
        gap: 20px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
    .nav-links.open { display: flex; }
    .navbar { padding-left: 20px; padding-right: 20px; }
}

/* ===== FOOTER ===== */
footer {
    background: var(--blue);
    color: rgba(255, 255, 255, 0.8);
    padding: 60px 0 30px;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-about .footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}
.footer-about .footer-logo span { color: var(--red); }
.footer-about p {
    margin: 16px 0 24px;
    max-width: 300px;
}
.social-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.4rem;
    margin-right: 16px;
    transition: color 0.2s;
}
.social-links a:hover { color: var(--red); }
.footer-col h4 {
    color: white;
    margin-bottom: 16px;
    font-weight: 600;
}
.footer-col ul {
    list-style: none;
}
.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col ul li a {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s;
}
.footer-col ul li a:hover { color: white; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* ===== HERO DE SECCIÓN ===== */
.tools-hero {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: white;
    padding: 100px 0 80px;
    text-align: center;
}
.tools-hero h1 {
    margin-bottom: 20px;
}
.tools-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== BOTONES ===== */
.btn-primary {
    background: var(--red);
    color: white;
    padding: 16px 36px;
    border-radius: 60px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 8px 20px rgba(255, 80, 69, 0.3);
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.btn-primary:hover {
    background: var(--red-dark);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 28px rgba(255, 80, 69, 0.4);
}
.btn-secondary {
    background: transparent;
    color: var(--blue);
    padding: 14px 32px;
    border-radius: 60px;
    font-weight: 600;
    border: 2px solid var(--blue);
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1rem;
}
.btn-secondary:hover {
    background: var(--blue);
    color: white;
    transform: translateY(-2px);
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
    align-items: center;
}

/* ===== FORMULARIOS ===== */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 6px;
    font-size: 0.95rem;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--light);
    color: var(--blue);
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(255, 80, 69, 0.1);
    background: var(--white);
}
.form-group .error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 4px;
    display: none;
}

/* ===== TARJETAS ===== */
.feature-card-large {
    background: var(--white);
    border-radius: 32px;
    padding: 48px;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    border: 1px solid rgba(0, 0, 0, 0.02);
}
.feature-card-large:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}
.feature-card-large .card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.feature-card-large .card-header i {
    font-size: 2.2rem;
    color: var(--red);
    background: rgba(255, 80, 69, 0.08);
    padding: 14px;
    border-radius: 20px;
}
.feature-card-large .card-header h3 {
    color: var(--blue);
}
.feature-card-large .card-desc {
    color: var(--gray);
    margin-bottom: 24px;
}

/* ===== RESULTADOS ===== */
.result-card {
    background: var(--light);
    border-radius: 24px;
    padding: 24px;
    margin-top: 24px;
    border-left: 4px solid var(--red);
    display: none;
}
.result-card h4 {
    color: var(--blue);
    margin-bottom: 12px;
}
.result-card p {
    margin: 6px 0;
    color: var(--blue);
}
.result-card .highlight {
    color: var(--red);
    font-weight: 700;
}
.result-card .result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) {
    .result-card .result-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== TABLAS ===== */
.table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 16px;
    border: 1px solid var(--border);
}
.price-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
}
.price-table th {
    background: var(--blue);
    color: white;
    padding: 16px 12px;
    font-weight: 600;
    text-align: left;
}
.price-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #eef2f6;
}
.price-table tr:last-child td {
    border-bottom: none;
}
.price-table tr:hover {
    background: #fafbfc;
}

/* ===== GRÁFICAS ===== */
.chart-container canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 280px;
    display: block;
}
.chart-container canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 280px;
}

/* ===== BREADCRUMB / BACK LINK ===== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blue);
    font-weight: 500;
    margin-bottom: 24px;
    transition: color 0.2s;
}
.back-link:hover {
    color: var(--red);
}