/* --- Base Reset & Typography --- */
:root {
    --primary-green: #28A745;
    --dark-blue: #0A1128;
    --light-grey: #F8F8F8;
    --text-dark: #333333;
    --text-light: #666666;
    --white: #FFFFFF;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --border-color: #E0E0E0;
    --danger-red: #DC3545;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-blue);
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 { font-size: 3.5rem; font-weight: 800; }
h2 { font-size: 2.5rem; font-weight: 700; }
h3 { font-size: 1.8rem; font-weight: 700; }
p { margin-bottom: 1em; }

a { text-decoration: none; transition: all 0.3s ease; }

/* --- Utility Classes --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.btn {
    display: inline-block; padding: 14px 30px; border-radius: 8px;
    font-weight: 600; font-size: 1rem; text-align: center; border: 2px solid transparent; cursor: pointer;
}
.btn-primary {
    background-color: var(--primary-green); color: var(--white);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}
.btn-primary:hover {
    background-color: #218838; transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}
.btn-login { color: var(--dark-blue); font-weight: 600; padding: 10px 20px; border-radius: 6px; }
.btn-login:hover { background-color: var(--light-grey); }

.text-center { text-align: center; }
.mb-4 { margin-bottom: 2rem; }
.py-section { padding: 80px 0; }
.section-title { margin-bottom: 4rem; position: relative; }
.section-title::after {
    content: ''; position: absolute; left: 50%; bottom: -15px;
    transform: translateX(-50%); width: 80px; height: 4px;
    background-color: var(--primary-green); border-radius: 2px;
}
.text-gradient {
    background: linear-gradient(45deg, var(--primary-green), #00C853);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* --- Header --- */
.header {
    background-color: var(--white); padding: 15px 0;
    box-shadow: 0 2px 10px var(--shadow-light);
    position: sticky; top: 0; z-index: 1000;
}
.nav-content { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { height: 40px; width: 40px; }
.nav-links { display: flex; gap: 30px; }
.nav-links a {
    position: relative; color: var(--text-dark); font-weight: 500;
    font-size: 1.05rem; transition: color 0.3s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--primary-green); }
.nav-links a::after {
    content: ''; position: absolute; left: 0; bottom: -6px;
    width: 100%; height: 2px; background-color: var(--primary-green);
    transform: scaleX(0); transform-origin: center;
    transition: transform 0.4s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(0.6); }
.nav-links a.nav-link-active::after { transform: scaleX(1); }
.nav-actions { display: flex; gap: 15px; align-items: center; }

/* Offset anchored sections so the sticky header doesn't cover them on scroll */
#features, #how-it-works, #dashboard, #roadmap, #team, #contact { scroll-margin-top: 90px; }

/* --- Hero Section --- */
.hero {
    position: relative; overflow: hidden;
    background: radial-gradient(circle at top right, #eef2f3, #ffffff);
    padding: 80px 0; min-height: 85vh; display: flex; align-items: center;
}
.hero-content { display: flex; align-items: center; gap: 50px; width: 100%; }
.hero-text { flex: 1; z-index: 2; }
.hero-actions { display: flex; gap: 20px; margin-top: 30px; align-items: center; }
.hero-image { flex: 1; perspective: 1000px; display: flex; justify-content: center; }

/* Animations */
@keyframes scanMove {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}
@keyframes blink {
    0% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
    100% { opacity: 0.2; transform: scale(1); }
}
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* --- Features --- */
/* Section backgrounds alternate white/light-grey down the page — see CLAUDE.md Architecture notes */
.features { background-color: var(--white); }
.features-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px; margin-top: 60px;
}
.feature-card {
    background-color: var(--white); border-radius: 12px; padding: 30px;
    box-shadow: 0 8px 25px var(--shadow-light); text-align: center;
    transition: transform 0.3s ease; border: 1px solid var(--border-color);
}
.feature-card:hover { transform: translateY(-10px); }
.feature-card h3 { font-size: 1.25rem; min-height: 50px; display: flex; align-items: center; justify-content: center; }
.feature-card .icon {
    width: 60px; height: 60px; margin: 0 auto 20px;
    background-color: var(--primary-green); border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 2rem; color: var(--white);
}

/* --- How It Works --- */
.how-it-works { background-color: var(--light-grey); }
.steps-container { max-width: 1500px; }
.steps-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px; margin-top: 60px;
}
.step-card {
    background-color: var(--white); border-radius: 12px; padding: 30px;
    box-shadow: 0 5px 20px var(--shadow-light); text-align: center;
}
.step-card .step-number {
    width: 50px; height: 50px; background-color: var(--dark-blue); color: var(--white);
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    font-size: 1.8rem; font-weight: 700; margin: 0 auto 20px;
}
@media (min-width: 992px) {
    .steps-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .step-card { padding: 24px 16px; }
    .step-card h3 { font-size: 1.15rem; min-height: 48px; display: flex; align-items: center; justify-content: center; }
}

/* --- Roadmap --- */
.roadmap { background-color: var(--light-grey); }
.roadmap-timeline {
    display: flex; justify-content: space-between; align-items: stretch;
    margin-top: 60px; position: relative;
}
.roadmap-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    text-align: center; position: relative; padding: 0 10px;
}
.roadmap-item:not(:first-child)::before {
    content: ''; position: absolute; top: 25px; left: -50%; width: 100%;
    height: 2px; background-color: var(--border-color); z-index: 1;
}
.roadmap-marker {
    width: 50px; height: 50px; background-color: var(--dark-blue); color: var(--white);
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    font-size: 1.2rem; font-weight: 700; position: relative; z-index: 2; flex-shrink: 0;
}
.roadmap-item.is-current .roadmap-marker { background-color: var(--primary-green); }
.roadmap-content {
    background-color: var(--white); border-radius: 12px; padding: 20px;
    box-shadow: 0 5px 20px var(--shadow-light); margin-top: 20px; max-width: 220px;
    flex: 1; text-align: center;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.roadmap-item.is-current .roadmap-content { border: 2px solid var(--primary-green); }
.roadmap-date {
    display: block; color: var(--primary-green); font-weight: 600;
    font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.roadmap-badge {
    display: inline-block; background-color: var(--primary-green); color: var(--white);
    font-size: 0.7rem; font-weight: 700; padding: 3px 10px; border-radius: 12px;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.roadmap-content h3 { font-size: 1.1rem; margin-bottom: 0.4em; }
.roadmap-content p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 0; }

/* Fixed per-field min-heights keep each row (date/title/description/badge) aligned
   across all 5 cards, sized to the tallest real copy at this card width: title
   wraps up to 2 lines ("Postulación CORFO"), description up to 3 ("Piloto Comercial"). */
.roadmap-field { overflow: hidden; width: 100%; }
.roadmap-field-date { min-height: 30px; }
.roadmap-field-title { min-height: 50px; display: flex; align-items: center; justify-content: center; }
.roadmap-field-description { min-height: 70px; }
.roadmap-field-badge { min-height: 32px; }

/* --- Team --- */
.team { background-color: var(--white); }
.team-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px; margin-top: 60px;
}
.team-card {
    background-color: var(--white); border-radius: 12px; padding: 30px;
    box-shadow: 0 8px 25px var(--shadow-light); text-align: center;
    transition: transform 0.3s ease; border: 1px solid var(--border-color);
}
.team-card:hover { transform: translateY(-10px); }
.team-avatar {
    width: 100px; height: 100px; margin: 0 auto 20px;
    background-color: var(--light-grey); border: 2px solid var(--border-color);
    border-radius: 50%; object-fit: cover;
}
.team-card h3 { font-size: 1.2rem; margin-bottom: 0.25em; }
.team-role { color: var(--text-light); font-size: 0.9rem; margin-bottom: 0; }
.team-linkedin {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; margin-top: 14px; color: var(--dark-blue);
}
.team-linkedin:hover { color: var(--primary-green); }

/* --- Contact Form --- */
.contact { background-color: var(--light-grey); }
.contact-form { max-width: 700px; margin: 60px auto 0; }
.form-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.form-group label { font-weight: 600; font-size: 0.9rem; color: var(--dark-blue); }
.form-group input, .form-group textarea {
    font-family: 'Inter', sans-serif; font-size: 1rem; color: var(--text-dark);
    padding: 12px 16px; border: 1px solid var(--border-color); border-radius: 8px;
    background-color: var(--white); transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}
.form-group textarea { resize: vertical; min-height: 140px; }
.contact-form .btn { width: 100%; }

/* Honeypot: kept off-screen (not display:none) so simple bots that skip hidden fields still fill it in */
.hp-field { position: absolute; left: -5000px; }

/* --- Toast Notification --- */
.toast {
    position: fixed; bottom: 30px; right: 30px; max-width: 320px;
    padding: 16px 20px; border-radius: 10px; color: var(--white); font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0; transform: translateY(20px); pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease; z-index: 2000;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast.success { background-color: var(--primary-green); }
.toast.error { background-color: var(--danger-red); }

/* --- Dashboard Section --- */
.dashboard { background-color: var(--white); }
.dashboard-mockup {
    background-color: #f0f2f5; padding: 60px; border-radius: 15px;
    margin-top: 40px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}
.dashboard-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px; min-width: 0;
}
.dashboard-card {
    background-color: var(--white); border-radius: 10px; padding: 25px;
    box-shadow: 0 5px 15px var(--shadow-light); border: 1px solid var(--border-color);
    min-width: 0; overflow: hidden;
}
.dashboard-card > div[id^="chart-"] { max-width: 100%; }
.dashboard-card-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
}
.status-indicator { width: 10px; height: 10px; border-radius: 50%; background-color: #ccc; }
.status-indicator.healthy { background-color: var(--primary-green); }
.status-indicator.stressed { background-color: #FFC107; }
.status-indicator.critical { background-color: #DC3545; }
.metric-value { font-size: 2.5rem; font-weight: 700; color: var(--primary-green); margin-bottom: 5px; }
.metric-unit { font-size: 1rem; color: var(--text-light); }
.card-small-text { font-size: 0.8rem; color: #777; margin-top: 10px; }
.card-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.chart-overlay-label {
    position: absolute; top: 55%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; pointer-events: none;
}
.chart-overlay-value { margin: 0; font-size: 1.8rem; color: #008FFB; }
.chart-overlay-caption { font-size: 0.8rem; color: #888; }

/* --- Testimonials & CTA --- */
.testimonials { background-color: var(--white); }
.testimonial-carousel {
    display: flex; gap: 30px; overflow-x: auto; padding-bottom: 20px;
    margin-top: 60px; scroll-snap-type: x mandatory;
}
.testimonial-card {
    flex: 0 0 400px; background: var(--white); padding: 30px;
    border-radius: 12px; box-shadow: 0 8px 25px var(--shadow-light);
    border: 1px solid var(--border-color); scroll-snap-align: start;
}
.testimonial-quote { font-style: italic; margin-bottom: 20px; }
.testimonial-author { display: flex; align-items: center; gap: 15px; }
.testimonial-author img {
    width: 50px; height: 50px; border-radius: 50%; object-fit: cover;
}
.logos-grid {
    display: flex; justify-content: center; gap: 40px; flex-wrap: wrap;
    margin-top: 60px; padding: 20px 0; opacity: 0.6;
}

/* --- Footer --- */
.footer {
    background-color: #0A1128; color: rgba(255, 255, 255, 0.7);
    padding: 60px 0 30px; font-size: 0.95rem;
}
.footer-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px; margin-bottom: 40px;
}
.footer-col h4 { color: var(--white); margin-bottom: 20px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: rgba(255, 255, 255, 0.7); }
.footer-col ul li a:hover { color: var(--primary-green); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 30px; text-align: center; }

/* --- Responsive --- */
/* Tap target enlarged to 44x44 while keeping the visual icon compact */
.menu-toggle {
    display: none; flex-direction: column; justify-content: center; align-items: center;
    width: 44px; height: 44px; cursor: pointer; gap: 5px;
}
.menu-toggle span { height: 3px; width: 24px; background: var(--dark-blue); transition: 0.3s; }
.menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    .hero-content { flex-direction: column; text-align: center; }
    .hero-image { margin-top: 50px; perspective: none !important; width: 100%; }
    .hero-actions { justify-content: center; }
    .glass-dashboard { transform: none !important; max-width: 100%; }
    .nav-links, .nav-actions .btn-primary { display: none; }
    .menu-toggle { display: flex; }

    .nav-links.mobile-open {
        display: flex; flex-direction: column; position: absolute;
        top: 100%; left: 0; width: 100%; background: var(--white);
        padding: 10px 20px; border-top: 1px solid var(--border-color);
        box-shadow: 0 8px 15px var(--shadow-light); z-index: 999;
    }
    .nav-links.mobile-open a { width: 100%; padding: 12px 0; }
    .nav-links.mobile-open a::after { display: none; }

    h1 { font-size: 2.8rem; }
    h2 { font-size: 2.1rem; }
    h3 { font-size: 1.5rem; }

    .dashboard-mockup { padding: 40px 25px; }
    .testimonial-card { flex: 0 0 85%; }

    /* 5 columns don't fit comfortably in the tablet range; switch to a vertical timeline */
    .roadmap-timeline { flex-direction: column; align-items: stretch; gap: 30px; }
    .roadmap-item { flex-direction: row; align-items: flex-start; text-align: left; padding: 0; }
    .roadmap-item:not(:first-child)::before { display: none; }
    .roadmap-item:not(:last-child)::after {
        content: ''; position: absolute; left: 25px; top: 50px; bottom: -30px;
        width: 2px; background-color: var(--border-color); z-index: 1;
    }
    .roadmap-content { margin-top: 0; margin-left: 20px; max-width: none; }

    /* Row alignment across sibling cards isn't relevant when stacked one-per-row */
    .roadmap-field-date, .roadmap-field-title, .roadmap-field-description, .roadmap-field-badge {
        min-height: auto;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.3rem; }

    .py-section { padding: 56px 0; }
    .hero { padding: 56px 0; min-height: auto; }

    /* A fixed 300px column minimum no longer fits narrow viewports; drop to a single column */
    .dashboard-mockup { padding: 25px 15px; }
    .dashboard-grid { grid-template-columns: 1fr; }

    .testimonial-card { flex: 0 0 90%; }
    .footer-grid { text-align: center; }

    .toast { left: 20px; right: 20px; bottom: 20px; max-width: none; }
}
