/* === Variables === */
:root {
    --primary-dark: #111827;
    --primary-blue: #1e40af;
    --accent-blue: #60a5fa;
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --bs-gray-300: #dee2e6;
}

/* === Reset básico (compatible con Bootstrap reboot) === */
*, *::before, *::after {
    box-sizing: border-box;
}

/* === Tipografía inicial === */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* === Preloader (debe estar en critical path) === */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 999999;
    background-color: var(--bg-light);
}

.preloader-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preloader-icon {
    width: 70px;
    height: 60px;
}

.loading-bar {
    width: 120px;
    height: 3px;
    margin-top: 30px;
    position: relative;
    overflow: hidden;
    background: #fff;
}

.loading-bar::before {
    content: "";
    width: 35px;
    height: 3px;
    background: var(--primary-dark);
    position: absolute;
    left: -34px;
    animation: bluebar 1.5s infinite ease;
}

@keyframes bluebar {
    50% { left: 96px; }
}

/* === Layout crítico === */
.container {
    width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: auto;
    margin-left: auto;
    max-width: 1140px;
}

/* === Header y navegación === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background-color: var(--bg-light);
    padding: 1rem 0;
    transition: padding 0.3s ease;
}

/* === Hero section (LCP) === */
.page-header-hero,
.hero-section {
    background: linear-gradient(90deg, var(--bg-dark) 0%, var(--primary-blue) 100%);
    position: relative;
    min-height: 75vh;
    display: flex;
    align-items: center;
    padding-top: 6rem;
    color: #fff;
}

.page-header-hero h1,
.hero-section h1 {
    color: #fff;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

/* === Utilidades críticas === */
.text-center {
    text-align: center;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.py-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.position-relative {
    position: relative;
}

.overflow-hidden {
    overflow: hidden;
}

.text-white {
    color: #fff;
}

/* === Botones críticos === */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-light {
    background: var(--bg-light);
    color: var(--primary-dark);
    border: none;
}

.btn-light:hover {
    background: var(--accent-blue);
    color: #fff;
    transform: translateY(-2px);
}

/* === Media queries críticos === */
@media (max-width: 992px) {
    .page-header-hero,
    .hero-section {
        text-align: center;
        min-height: auto;
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    .page-header-hero h1,
    .hero-section h1 {
        font-size: 2rem;
    }
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* === Estado de carga de fuentes === */
.fonts-loading {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.fonts-loaded {
    font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* === Animaciones críticas === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeIn 0.6s ease-out;
}
