:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --success: #10b981;
    --info: #6366f1;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
}

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

html {
    scroll-behavior: smooth;
}

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

/* ── Navigation ── */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    z-index: 100;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

#navbar.scrolled {
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.98);
}

.nav-progress {
    position: absolute;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--info));
    width: 0%;
    transition: width 0.1s linear;
    z-index: 1;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.875rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

/* Desktop nav links (fixed to appear inline in header area) */
.nav-links {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    list-style: none;
    position: fixed;
    top: 0;
    right: max(2rem, calc((100vw - 1200px) / 2 + 2rem));
    padding: 0.875rem 0;
    z-index: 101;
}

.nav-links li a:not(.btn-primary) {
    text-decoration: none;
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    transition: all 0.2s;
    position: relative;
}

.nav-links li a:not(.btn-primary):hover {
    color: var(--primary);
    background: var(--gray-50);
}

.nav-links li a.active {
    color: var(--primary);
    background: rgba(37,99,235,0.08);
}

.nav-links .btn-primary {
    color: white;
    margin-left: 0.5rem;
}

.nav-links .btn-primary:hover {
    color: white;
}

/* Hamburger button */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0;
    position: relative;
    z-index: 1101;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2.5px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    background: transparent;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding: 10rem 2rem 6rem;
    background: linear-gradient(180deg, #f0f9ff 0%, white 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid var(--gray-200);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.hero-badge i {
    color: var(--accent);
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary), var(--info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-image {
    max-width: 1000px;
    margin: 4rem auto 0;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.12);
    border: 1px solid var(--gray-200);
}

.hero-image-placeholder {
    background: linear-gradient(135deg, var(--gray-100), var(--gray-50));
    padding: 2rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dashboard-preview {
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.dashboard-header {
    background: var(--gray-800);
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
}

.dashboard-header span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dashboard-header span:nth-child(1) { background: #ef4444; }
.dashboard-header span:nth-child(2) { background: #f59e0b; }
.dashboard-header span:nth-child(3) { background: #10b981; }

.dashboard-body {
    display: flex;
    min-height: 300px;
}

.dashboard-sidebar {
    width: 200px;
    background: var(--gray-800);
    padding: 1rem;
}

.sidebar-item {
    color: var(--gray-400);
    font-size: 0.75rem;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-item.active {
    color: white;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 0.5rem;
    margin: 0.25rem 0;
}

.dashboard-main {
    flex: 1;
    padding: 1.5rem;
    background: var(--gray-50);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--gray-400);
    text-transform: uppercase;
}

.content-table {
    background: white;
    border-radius: 8px;
    padding: 1rem;
}

.table-row {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.75rem;
    color: var(--gray-600);
}

.table-row:last-child {
    border-bottom: none;
}

.badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Features Section */
.features {
    padding: 6rem 2rem;
    background: white;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

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

.section-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    border-color: transparent;
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.feature-icon.blue { background: #dbeafe; color: #2563eb; }
.feature-icon.green { background: #dcfce7; color: #16a34a; }
.feature-icon.purple { background: #f3e8ff; color: #9333ea; }
.feature-icon.orange { background: #ffedd5; color: #ea580c; }
.feature-icon.pink { background: #fce7f3; color: #db2777; }
.feature-icon.teal { background: #ccfbf1; color: #0d9488; }

.feature-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--gray-500);
    line-height: 1.6;
}

/* Roles Section */
.roles {
    padding: 6rem 2rem;
    background: var(--gray-50);
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.role-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.role-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.role-header {
    padding: 1.5rem;
    color: white;
    position: relative;
}

.role-header.super { background: linear-gradient(135deg, #7c3aed, #6366f1); }
.role-header.admin { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.role-header.profesor { background: linear-gradient(135deg, #059669, #10b981); }
.role-header.apoderado { background: linear-gradient(135deg, #d97706, #f59e0b); }

.role-header i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.role-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.role-body {
    padding: 1.5rem;
}

.role-list {
    list-style: none;
}

.role-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.role-list li i {
    color: var(--success);
    margin-top: 0.2rem;
    flex-shrink: 0;
}

/* How it works */
.how-it-works {
    padding: 6rem 2rem;
    background: white;
}

.steps {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.step {
    text-align: center;
    max-width: 250px;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 2rem;
    right: -1rem;
    width: 2rem;
    height: 2px;
    background: var(--gray-200);
}

.step-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.step p {
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* CTA Section */
.cta {
    padding: 6rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--info));
    text-align: center;
    color: white;
}

.cta h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.cta .btn-white {
    background: white;
    color: var(--primary);
    padding: 0.875rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.cta .btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Footer */
footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 3rem 2rem;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

.footer-logo span {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

footer p {
    font-size: 0.85rem;
}

/* ── Mobile Nav (overlay drawer) ── */
@media (max-width: 900px) {
    .mobile-toggle {
        display: flex;
    }

    /* Overlay backdrop (sibling of header, no nesting) */
    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 998;
        cursor: pointer;
    }

    .nav-overlay.active {
        display: block;
    }

    /* Slide-in drawer (override desktop fixed positioning) */
    .nav-links {
        top: 0;
        right: 0;
        transform: translateX(100%);
        width: min(320px, 80vw);
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 5.5rem 2rem 2rem;
        gap: 0.25rem;
        z-index: 999;
        box-shadow: -8px 0 30px rgba(0,0,0,0.12);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li a:not(.btn-primary) {
        display: block;
        padding: 0.75rem 1rem;
        font-size: 1.05rem;
        border-radius: 10px;
    }

    .nav-links .btn-primary {
        display: flex;
        justify-content: center;
        margin-top: 0.75rem;
        margin-left: 0;
        padding: 0.875rem;
        font-size: 1rem;
    }

    /* Push body content when menu opens (optional) */
    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 8rem 1.5rem 4rem;
    }

    .dashboard-body {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
    }

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

    .step:not(:last-child)::after {
        display: none;
    }

    .steps {
        flex-direction: column;
        align-items: center;
    }
}

/* Skip Link (accessibility) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

/* Screen reader only */
.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;
}

/* Testimonials */
.testimonials {
    padding: 6rem 2rem;
    background: var(--gray-50);
}

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

.testimonial-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.testimonial-stars {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.testimonial-card p {
    font-size: 0.95rem;
    color: var(--gray-600);
    line-height: 1.7;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.testimonial-author strong {
    font-size: 0.95rem;
    color: var(--gray-900);
}

.testimonial-author span {
    font-size: 0.8rem;
    color: var(--gray-400);
}

/* FAQ */
.faq {
    padding: 6rem 2rem;
    background: white;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary-light);
}

.faq-item summary {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-900);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    user-select: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '\f282';
    font-family: 'bootstrap-icons';
    font-size: 0.85rem;
    color: var(--gray-400);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.faq-item[open] summary::after {
    transform: rotate(180deg);
}

.faq-item[open] summary {
    border-bottom: 1px solid var(--gray-200);
}

.faq-item div {
    padding: 0 1.5rem 1.25rem;
}

.faq-item p {
    font-size: 0.95rem;
    color: var(--gray-500);
    line-height: 1.7;
}

/* Form */
.cta-form {
    max-width: 600px;
    margin: 2rem auto 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group {
    flex: 1;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    color: white;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s;
}

.form-group input::placeholder {
    color: rgba(255,255,255,0.6);
}

.form-group input:focus {
    border-color: white;
    background: rgba(255,255,255,0.18);
}

.btn-form {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    cursor: pointer;
}

.cta-email-alt {
    font-size: 0.85rem;
    opacity: 0.8;
}

.cta-email-alt a {
    color: white;
    font-weight: 600;
}

/* Footer enhancements */
.footer-desc {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-copy {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .form-row {
        flex-direction: column;
    }

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

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}