/* CSS Unificado y Optimizado para Home - Sin Redundancias */

/* Variables CSS para consistencia */
:root {
    --primary-color: #790707;
    --primary-hover: #8a0a0a;
    --secondary-color: #214e78;
    --secondary-hover: #2a689f;
    --accent-color: #ee5a24;
    --text-dark: #1e293b;
    --text-medium: #4a5568;
    --text-light: #64748b;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --border-light: #e2e8f0;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --border-radius: 8px;
    --border-radius-lg: 20px;
}

/* Reset y optimizaciones base */
* {
    box-sizing: border-box;
}

.home-page {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    font-display: swap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(
        135deg,
        rgba(33, 78, 120, 0.95) 0%,
        rgba(42, 104, 159, 0.95) 25%,
        rgba(59, 130, 246, 0.9) 50%,
        rgba(30, 64, 95, 0.9) 75%,
        rgba(15, 23, 42, 0.95) 100%
    );
    color: white;
    padding: 80px 0 100px 0;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
            circle at 20% 80%,
            rgba(255, 255, 255, 0.1) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 20%,
            rgba(255, 255, 255, 0.08) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 40% 40%,
            rgba(255, 255, 255, 0.05) 0%,
            transparent 50%
        );
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-logo {
    margin-bottom: 2rem;
}

.hero-logo img {
    max-width: 180px;
    height: auto;
    transition: transform var(--transition-normal);
}

.hero-logo:hover img {
    transform: scale(1.05);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 2rem;
    opacity: 0.95;
    line-height: 1.6;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn-hero-primary {
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    color: white;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius-lg);
    text-decoration: none;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(121, 7, 7, 0.3);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-hero-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.btn-hero-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(121, 7, 7, 0.5);
    color: white;
    text-decoration: none;
}

.btn-hero-primary:hover::before {
    left: 100%;
}

.btn-hero-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 13px 28px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius-lg);
    text-decoration: none;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-hero-secondary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s;
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
}

.btn-hero-secondary:hover::before {
    left: 100%;
}

.btn-hero-login {
    background: white;
    color: var(--secondary-color);
    border: 2px solid white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-hero-login::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.btn-hero-login:hover {
    background: #f8f9fa;
    color: var(--secondary-color);
    border-color: #f8f9fa;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

.btn-hero-login:hover::before {
    left: 100%;
}

/* Features Section */
.features-section {
    padding: 80px 0 60px 0;
    background: var(--bg-white);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-block;
    background: linear-gradient(
        45deg,
        var(--secondary-color),
        var(--secondary-hover)
    );
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.badge-icon {
    margin-right: 8px;
}

.section-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card,
.wow-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px var(--shadow-light);
    transition: all var(--transition-normal);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.feature-card::before,
.wow-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(
        45deg,
        var(--secondary-color),
        var(--secondary-hover)
    );
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.feature-card:hover,
.wow-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow-medium);
}

.feature-card:hover::before,
.wow-card:hover::before {
    transform: scaleX(1);
}

.feature-icon,
.corporate-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(
        45deg,
        var(--secondary-color),
        var(--secondary-hover)
    );
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.feature-icon::before,
.corporate-icon::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        var(--secondary-hover),
        var(--secondary-color)
    );
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.feature-icon:hover,
.corporate-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

.feature-icon:hover::before,
.corporate-icon:hover::before {
    opacity: 1;
}

.feature-icon i,
.corporate-icon i {
    position: relative;
    z-index: 1;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.feature-description {
    color: var(--text-medium);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.feature-benefit,
.corporate-badge {
    background: var(--primary-color);
    color: white;
    padding: 6px 16px;
    border-radius: var(--border-radius-lg);
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(121, 7, 7, 0.3);
    transition: all var(--transition-normal);
}

.feature-benefit:hover,
.corporate-badge:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(121, 7, 7, 0.4);
}

.benefit-text {
    color: white;
}

/* Login Section */
.login-section {
    padding: 60px 0 60px 0;
    background: var(--bg-light);
}

.login-form-container {
    max-width: 450px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: 0 20px 40px var(--shadow-light);
    border: 1px solid var(--border-light);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo img {
    max-width: 180px;
    height: auto;
}

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    z-index: 10;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-normal);
}

.password-toggle:hover {
    color: var(--secondary-color);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.password-field .input-data {
    padding-right: 45px;
}

.login-form-container .icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    z-index: 5;
}

.login-form-container .input-data {
    padding-left: 45px;
}

.form-control {
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 12px 15px;
    font-size: 1rem;
    transition: all var(--transition-normal);
    background: var(--bg-light);
    width: 100%;
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(33, 78, 120, 0.25);
    background: var(--bg-white);
    outline: none;
}

.btn-custom {
    background: linear-gradient(
        135deg,
        var(--primary-color) 0%,
        var(--primary-hover) 100%
    );
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all var(--transition-normal);
    width: 100%;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    display: block;
}

.btn-custom:hover {
    background: linear-gradient(
        135deg,
        var(--primary-hover) 0%,
        var(--primary-color) 100%
    );
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 8px 25px rgba(121, 7, 7, 0.4);
}

.create-account-container {
    text-align: center;
    margin-top: 5px;
}

.create-account-container a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-normal);
    font-size: 1.1rem;
    white-space: nowrap;
}

.create-account-container a:hover {
    color: var(--primary-hover);
}

#recover-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-normal);
}

#recover-link:hover {
    color: var(--primary-hover);
}

#have-account-title {
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 2px;
    text-align: center;
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 30px 0 60px 0;
        min-height: 100vh;
    }

    .hero-logo img {
        max-width: 150px;
    }

    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 0.8rem;
        text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.2rem;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
        padding: 0 10px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 0 10px;
    }

    .btn-hero-primary,
    .btn-hero-secondary,
    .btn-hero-login {
        width: 100%;
        max-width: 250px;
        padding: 10px 20px;
        font-size: 0.9rem;
        min-height: 44px;
        touch-action: manipulation;
    }

    .btn-hero-login {
        background: white;
        color: var(--secondary-color);
        border: 3px solid white;
        box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .features-section {
        padding: 40px 0 40px 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 15px;
    }

    .feature-card,
    .wow-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .feature-icon,
    .corporate-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin: 0 auto 1rem;
    }

    .feature-title {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
        line-height: 1.4;
    }

    .feature-description {
        font-size: 1rem;
        line-height: 1.5;
    }

    .benefit-text {
        font-size: 0.95rem;
        font-weight: 600;
    }

    .login-section {
        padding: 30px 0 40px 0;
    }

    .login-form-container {
        margin: 0 15px;
        padding: 1.5rem;
    }

    .login-logo img {
        max-width: 120px;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .btn-custom {
        padding: 10px 25px;
        font-size: 1rem;
        min-height: 44px;
        touch-action: manipulation;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 60px 0 80px 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .features-section,
    .login-section {
        padding: 40px 0 40px 0;
    }
}

/* Optimizaciones de rendimiento */
.feature-card,
.wow-card,
.btn-hero-primary,
.btn-hero-secondary,
.btn-hero-login {
    will-change: transform;
}

.hero-section,
.features-section,
.login-section {
    contain: layout style paint;
}

/* Accesibilidad */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn-hero-primary:focus-visible,
.btn-hero-secondary:focus-visible,
.btn-hero-login:focus-visible,
.btn-custom:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Animaciones optimizadas solo para desktop */
@media (min-width: 769px) {
    .hero-logo {
        animation: logoFloat 3s ease-in-out infinite;
    }

    @keyframes logoFloat {
        0%,
        100% {
            transform: translateY(0px);
        }
        50% {
            transform: translateY(-10px);
        }
    }

    .feature-card,
    .wow-card {
        opacity: 0;
        transform: translateY(50px);
        animation: cardSlideIn 0.6s ease forwards;
    }

    .feature-card:nth-child(1),
    .wow-card:nth-child(1) {
        animation-delay: 0.1s;
    }
    .feature-card:nth-child(2),
    .wow-card:nth-child(2) {
        animation-delay: 0.2s;
    }
    .feature-card:nth-child(3),
    .wow-card:nth-child(3) {
        animation-delay: 0.3s;
    }
    .feature-card:nth-child(4),
    .wow-card:nth-child(4) {
        animation-delay: 0.4s;
    }
    .feature-card:nth-child(5),
    .wow-card:nth-child(5) {
        animation-delay: 0.5s;
    }
    .feature-card:nth-child(6),
    .wow-card:nth-child(6) {
        animation-delay: 0.6s;
    }

    @keyframes cardSlideIn {
        0% {
            opacity: 0;
            transform: translateY(50px) scale(0.9);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}
