/* ==========================================================================
   CSS Variables & Tokens
   ========================================================================== */
:root {
    /* Colors */
    --primary-500: #506CF8;
    --primary-400: #65A8FB;
    --primary-600: #3D93FF;
    --primary-700: #1678F2;

    --neutral-900: #000000;
    --neutral-700: #4F555A;
    --neutral-400: #8A8585;
    --neutral-200: #D9D9D9;

    --bg-light: #F3F3FD;
    --bg-white: #FFFFFF;

    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Typography */
    --font-main: 'Inter', sans-serif;

    /* Spacing */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;

    /* Effects */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -3px rgba(80, 108, 248, 0.1), 0 4px 6px -2px rgba(80, 108, 248, 0.05);
    --radius-md: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--neutral-700);
    line-height: 1.6;
    background-color: var(--bg-white);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--neutral-900);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: var(--primary-500);
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.text-center {
    text-align: center;
}

.bg-light {
    background-color: var(--bg-light);
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--primary-500);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: var(--primary-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-500);
    border-color: var(--primary-500);
}

.btn-outline:hover {
    background-color: var(--primary-500);
    color: var(--bg-white);
}

.btn-text {
    background: none;
    padding: 0;
    color: var(--primary-500);
}

.btn-text:hover {
    color: var(--primary-700);
}

.btn-block {
    width: 100%;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--neutral-200);
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 65px;
    /* fallback style if img is missing */
    background-color: #f0f0f0;
    border-radius: 4px;
}

.logo-text {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-500);
    display: none;
    /* Show only if image fails via JS or just hidden initially */
}

/* Triggered by JS if img fails */
.logo-img.error {
    display: none;
}

.logo-img.error+.logo-text {
    display: block;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav-list {
    display: flex;
    gap: var(--space-lg);
}

.nav-link {
    color: var(--neutral-700);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-500);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.lang-selector {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--neutral-400);
    cursor: pointer;
    user-select: none;
}

.lang.active {
    color: var(--primary-500);
}

.separator {
    margin: 0 4px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--neutral-900);
    cursor: pointer;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    padding-top: 120px;
    /* Account for fixed header */
    padding-bottom: var(--space-xl);
    background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-white) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background-color: rgba(80, 108, 248, 0.1);
    color: var(--primary-500);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: var(--space-md);
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--neutral-700);
    margin-bottom: var(--space-lg);
    max-width: 90%;
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
}

/* Dashboard Mockup (HTML/CSS visual) */
.hero-visual {
    position: relative;
}

.dashboard-mockup {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--neutral-200);
    overflow: hidden;
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: var(--transition);
}

.dashboard-mockup:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.mockup-header {
    background-color: #FAFAFA;
    padding: 1rem;
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    align-items: center;
}

.mockup-dots {
    display: flex;
    gap: 6px;
    margin-right: 1rem;
}

.mockup-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.mockup-dots span:nth-child(1) {
    background-color: #FF5F56;
}

.mockup-dots span:nth-child(2) {
    background-color: #FFBD2E;
}

.mockup-dots span:nth-child(3) {
    background-color: #27C93F;
}

.mockup-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neutral-400);
}

.mockup-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: #FAFCFF;
}

.mockup-card {
    background: var(--bg-white);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(80, 108, 248, 0.1);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-icon {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.fatigue-icon {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.card-info h4 {
    font-size: 0.9rem;
    color: var(--neutral-400);
    margin-bottom: 0.25rem;
}

.status-high {
    color: var(--danger);
    font-weight: 600;
    font-size: 1.1rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--neutral-200);
    border-radius: 10px;
    margin: 6px 0;
}

.progress-fill {
    height: 100%;
    background-color: var(--warning);
    border-radius: 10px;
}

.status-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.stats-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-500);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--neutral-400);
}

/* ==========================================================================
   Sections General
   ========================================================================== */
.section {
    padding: var(--space-2xl) 0;
}

.section-header {
    margin-bottom: var(--space-xl);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--neutral-700);
}

/* ==========================================================================
   Funcionalidades
   ========================================================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.feature-card {
    background-color: var(--bg-white);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--neutral-200);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-400);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(80, 108, 248, 0.1);
    color: var(--primary-500);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.feature-desc {
    color: var(--neutral-700);
    font-size: 0.95rem;
}

/* ==========================================================================
   Beneficios
   ========================================================================== */
.benefits-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
}

.benefit-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

.benefit-tag {
    display: inline-block;
    color: var(--primary-600);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.benefit-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.benefit-desc {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.benefit-list li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
}

.benefit-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-500);
    font-weight: bold;
}

.placeholder-img {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Planes de Suscripción
   ========================================================================== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    align-items: start;
}

.pricing-card {
    background-color: var(--bg-white);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    position: relative;
    transition: var(--transition);
}

.pricing-card:hover {
    box-shadow: var(--shadow-lg);
}

.pricing-card.popular {
    border: 2px solid var(--primary-500);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-500);
    color: var(--bg-white);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pricing-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--neutral-200);
}

.plan-name {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.plan-desc {
    color: var(--neutral-400);
    font-size: 0.9rem;
}

.pricing-features ul li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.95rem;
}

.pricing-features ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.pricing-cta {
    margin-top: 2rem;
}

.plan-btn {
    width: 100%;
}

/* ==========================================================================
   Contacto
   ========================================================================== */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-xl);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--primary-500);
}

.contact-item span {
    color: var(--neutral-700);
    font-weight: 500;
}

.contact-form-wrapper {
    background-color: var(--bg-white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--neutral-200);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(80, 108, 248, 0.2);
}

.form-success {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

/* ==========================================================================
   Términos del Servicio
   ========================================================================== */
.terms-card {
    background-color: var(--bg-white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.terms-icon {
    width: 64px;
    height: 64px;
    background-color: var(--bg-light);
    color: var(--primary-500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}

.terms-title {
    margin-bottom: 1rem;
}

.terms-summary {
    color: var(--neutral-700);
    margin-bottom: 1.5rem;
}

.terms-details {
    text-align: left;
    margin-top: 2rem;
    animation: fadeIn 0.3s ease;
}

.terms-details hr {
    border: 0;
    height: 1px;
    background-color: var(--neutral-200);
    margin-bottom: 2rem;
}

.terms-details h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-700);
}

.terms-details p {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background-color: var(--neutral-900);
    color: var(--bg-white);
    padding-top: var(--space-2xl);
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-tagline {
    color: var(--neutral-400);
    margin-top: 1rem;
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    gap: var(--space-xl);
}

.link-column h4,
.footer-social h4 {
    color: var(--bg-white);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.link-column a {
    display: block;
    color: var(--neutral-400);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.link-column a:hover {
    color: var(--primary-400);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--bg-white);
    border-radius: 50%;
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--primary-500);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--neutral-400);
    font-size: 0.9rem;
}

/* ==========================================================================
   Media Queries (Responsive)
   ========================================================================== */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 3rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin: 0 auto;
    }

    .pricing-card.popular {
        transform: none;
    }
}

@media (max-width: 900px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--bg-white);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2rem;
        transition: var(--transition);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        align-items: center;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .nav-link {
        font-size: 1.2rem;
    }

    .nav-actions {
        flex-direction: column;
        width: 100%;
        gap: 1.5rem;
    }

    .btn-login {
        width: 100%;
        max-width: 300px;
    }

    .mobile-toggle {
        display: block;
    }

    .logo-img {
        height: 35px;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-subtitle {
        margin: 0 auto 2rem auto;
    }

    .hero-cta {
        justify-content: center;
    }

    .dashboard-mockup {
        transform: none;
        margin-top: 2rem;
    }

    .dashboard-mockup:hover {
        transform: none;
    }

    .contact-container {
        grid-template-columns: 1fr;
    }

    .contact-info {
        text-align: center;
    }

    .section-subtitle {
        text-align: center !important;
        margin: 0 auto 2rem auto !important;
    }

    .contact-details {
        align-items: center;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .social-icons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .benefit-block {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .benefit-block.image-left .benefit-visual {
        order: -1;
    }

    .benefit-list li {
        text-align: left;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .terms-card {
        padding: 1.5rem;
    }
}

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

.terms-page-content {
    max-width: 1000px;
    margin: 0 auto;
    padding-left: 2rem;
}