/* Design System - El Faro (CCAC de Coosajo R.L.) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Paleta de colores */
    --primary: #132e60;       /* Azul marino profundo de El Faro */
    --primary-rgb: 19, 46, 96;
    --secondary: #ffb606;     /* Amarillo/Dorado vibrante (Faro) */
    --secondary-rgb: 255, 182, 6;
    --accent: #009434;        /* Verde Coosajo/Cooperativo */
    --accent-rgb: 0, 148, 52;
    --dark: #0f172a;          /* Slate 900 */
    --light: #f8fafc;         /* Slate 50 */
    --border: #e2e8f0;        /* Slate 200 */
    
    /* Variables de texto */
    --text-primary: #1e293b;   /* Slate 800 */
    --text-secondary: #64748b; /* Slate 500 */
    --text-light: #94a3b8;     /* Slate 400 */
    
    /* Fuentes */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Sombras y efectos */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Transiciones */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset general */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary);
    font-weight: 700;
    line-height: 1.25;
}

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

/* Contenedores y grillas */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.grid {
    display: grid;
    gap: 2rem;
}

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

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

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Botones y UI Elements */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--secondary);
    color: var(--primary);
}

.btn-primary:hover {
    background-color: #e09e00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 182, 6, 0.3);
}

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

.btn-secondary:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-white {
    background-color: white;
    color: var(--primary);
    box-shadow: var(--shadow);
}

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

/* Navbar */
.navbar {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 0.75rem 0;
    background-color: white;
    box-shadow: var(--shadow-sm);
}

.navbar .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.logo svg {
    width: 2.25rem;
    height: 2.25rem;
}

.logo span {
    background: linear-gradient(135deg, var(--primary) 60%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: none;
    list-style: none;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--secondary);
    transition: var(--transition);
}

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

.nav-link:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Hero Section */
.hero {
    padding: 9rem 0 6rem 0;
    background: radial-gradient(circle at 90% 10%, rgba(255, 182, 6, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 10% 90%, rgba(0, 148, 52, 0.1) 0%, transparent 40%),
                linear-gradient(to bottom, #f1f5f9, var(--light));
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 700px;
    text-align: center;
    margin: 0 auto;
}

.hero-badge {
    background-color: rgba(0, 148, 52, 0.1);
    color: var(--accent);
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 148, 52, 0.2);
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--primary) 70%, #1e40af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.hero-description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

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

/* Sections */
.section {
    padding: 5rem 0;
}

.section-bg {
    background-color: white;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 4rem auto;
}

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

.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.section-desc {
    color: var(--text-secondary);
}

/* Cursos Cards */
.course-card {
    background-color: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(19, 46, 96, 0.2);
}

.course-card-body {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.course-icon-wrapper {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-md);
    background-color: rgba(19, 46, 96, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.course-card:hover .course-icon-wrapper {
    background-color: var(--primary);
    transform: scale(1.1);
}

.course-card:hover .course-icon-wrapper span {
    filter: brightness(2);
}

.course-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.course-card-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.course-meta {
    list-style: none;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.course-meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.course-meta-item svg {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--accent);
}

/* Detail Sections for Courses */
.course-detail-section {
    padding: 6rem 0;
    border-bottom: 1px solid var(--border);
}

.course-detail-section:last-child {
    border-bottom: none;
}

.course-detail-badge {
    background-color: var(--primary);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.course-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .course-detail-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .course-detail-grid.reverse > div:first-child {
        order: 2;
    }
}

.module-list {
    list-style: none;
    margin-top: 2rem;
}

.module-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    background-color: white;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.module-item:hover {
    border-color: rgba(19, 46, 96, 0.2);
    box-shadow: var(--shadow);
    transform: translateX(5px);
}

.module-number {
    width: 2rem;
    height: 2rem;
    background-color: rgba(19, 46, 96, 0.1);
    color: var(--primary);
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.module-content h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.module-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.module-time {
    display: inline-block;
    background-color: var(--light);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Info Box / Dynamic Dinámica */
.dynamics-card {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.dynamics-card::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(255, 182, 6, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.dynamics-card h3 {
    color: var(--secondary);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dynamics-card p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.dynamics-card ul {
    list-style: none;
    margin-top: 1rem;
}

.dynamics-card li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.dynamics-card li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

/* Footer */
.footer {
    background-color: var(--dark);
    color: #94a3b8;
    padding: 4rem 0 2rem 0;
    border-top: 1px solid #1e293b;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.footer-brand h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-brand p {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.footer-logo svg {
    width: 2rem;
    height: 2rem;
}

.footer-logo span {
    font-weight: 800;
}

.footer-links-title {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    font-size: 0.9rem;
}

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

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

/* Alert Messages (Django Messages) */
.messages-container {
    position: fixed;
    top: 5.5rem;
    right: 1.5rem;
    z-index: 1050;
    max-width: 400px;
    width: calc(100vw - 3rem);
}

.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: white;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background-color: var(--accent);
}

.alert-error, .alert-danger {
    background-color: #ef4444;
}

.alert-warning {
    background-color: var(--secondary);
    color: var(--primary);
}

.alert-info {
    background-color: var(--primary);
}

.alert-close {
    background: transparent;
    border: none;
    color: currentColor;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
