:root {
    --color-primary: #0B6FA4;
    --color-primary-light: #82E7F2;
    --color-mint: #B1FFBD;
    --color-turquoise: #4CCFD8;
    --color-bg: #F5F9FB;
    --color-text: #12313F;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.06);
    --shadow-light: 0 6px 15px rgba(11, 111, 164, 0.15);
    --transition-fast: 0.2s ease-in-out;
    --max-width: 1120px;
} 

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(130, 231, 242, 0.12), transparent 55%),
        radial-gradient(circle at bottom right, rgba(177, 255, 189, 0.18), transparent 55%),
        #F5F9FB;
    color: var(--color-text);
}

/* Layout general */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding-inline: 1.25rem;
}

/* HEADER / NAVBAR */
.app-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(12, 80, 125, 0.08);
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: radial-gradient(circle at 20% 0%, var(--color-primary-light), var(--color-primary));
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 1rem;
}

.brand-text-title {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.brand-text-sub {
    font-size: 0.75rem;
    opacity: 0.75;
}

/* Navegación principal */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Botón hamburguesa para móvil */
.nav-toggle {
    display: none;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 999px;
}

.nav-toggle-box {
    width: 24px;
    height: 18px;
    position: relative;
    display: inline-block;
}

.nav-toggle-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 999px;
    background: rgba(18, 49, 63, 0.9);
    transition: transform var(--transition-fast), opacity var(--transition-fast), top var(--transition-fast), bottom var(--transition-fast);
}

.nav-toggle-line:nth-child(1) {
    top: 0;
}
.nav-toggle-line:nth-child(2) {
    top: 8px;
}
.nav-toggle-line:nth-child(3) {
    bottom: 0;
}

/* Links de navegación */
.nav-link,
.nav-links .btn {
    font-size: 0.85rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.nav-link--primary {
    background: var(--color-primary);
    color: #FFFFFF;
    box-shadow: var(--shadow-soft);
}

.nav-link--primary:hover {
    background: #084f78;
}

.nav-link:hover {
    background: rgba(11, 111, 164, 0.08);
}

/* HERO / PÁGINA INICIO */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
    padding: 2.5rem 0 2rem;
}

.hero-title {
    font-size: clamp(2rem, 2.4rem, 2.7rem);
    line-height: 1.15;
    margin: 0 0 0.75rem;
    color: #0B2A3F;
}

.hero-highlight {
    background: linear-gradient(120deg, var(--color-primary), var(--color-turquoise));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    font-size: 0.98rem;
    max-width: 520px;
    margin: 0 0 1rem;
    opacity: 0.9;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    background: rgba(11, 111, 164, 0.06);
    color: #0B2A3F;
}

.badge--mint {
    background: rgba(177, 255, 189, 0.55);
    color: #0f5c2a;
}

.badge--blue {
    background: rgba(130, 231, 242, 0.55);
    color: #05526e;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.hero-aside {
    display: flex;
    justify-content: center;
}

.hero-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 1.4rem 1.3rem 1.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(11, 111, 164, 0.08);
    max-width: 360px;
}

.hero-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.hero-card-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.hero-pill {
    padding: 0.15rem 0.6rem;
    font-size: 0.73rem;
    border-radius: 999px;
    background: rgba(11, 111, 164, 0.08);
    color: #0B2A3F;
}

.hero-card-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-size: 0.87rem;
}

.hero-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--color-primary);
    display: inline-block;
    margin-right: 0.45rem;
}

/* TARJETAS / LISTADOS GENERALES */
.section-title {
    font-size: 1.4rem;
    margin: 1.8rem 0 0.7rem;
    color: #0B2A3F;
}

.card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.3rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(11, 111, 164, 0.06);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.2rem;
    margin-top: 1rem;
}

.module-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid rgba(11, 111, 164, 0.06);
    background: #FFFFFF;
}

.module-card.free {
    border-left: 4px solid var(--color-mint);
}

.module-card.paid {
    border-left: 4px solid var(--color-primary-light);
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.module-title {
    font-weight: 600;
    font-size: 0.98rem;
}

.badge-status {
    font-size: 0.75rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}

.badge-status.free {
    background: rgba(177, 255, 189, 0.6);
    color: #146b26;
}

.badge-status.paid {
    background: rgba(130, 231, 242, 0.6);
    color: #0a5266;
}

.module-desc {
    font-size: 0.88rem;
    opacity: 0.9;
}

.module-footer {
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.8rem;
}

/* BOTONES GENERALES */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.7rem 1.3rem;
    border-radius: 999px;
    font-size: 0.9rem;
    border: none;
    background: var(--color-primary);
    color: #FFFFFF;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
    background: #084f78;
}

.btn:focus-visible {
    outline: 2px solid var(--color-turquoise);
    outline-offset: 2px;
}

.btn.secondary {
    background: #FFFFFF;
    color: var(--color-primary);
    border: 1px solid rgba(11, 111, 164, 0.25);
    box-shadow: none;
}

.btn.secondary:hover {
    background: rgba(11, 111, 164, 0.03);
}

.helper-text {
    font-size: 0.82rem;
    opacity: 0.8;
}

/* FORMULARIOS */
.auth-wrapper {
    display: flex;
    justify-content: center;
    padding: 2.5rem 0;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #FFFFFF;
    border-radius: 20px;
    padding: 1.8rem 1.6rem 2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(11, 111, 164, 0.06);
}

.auth-title {
    margin: 0 0 0.35rem;
    font-size: 1.3rem;
}

.auth-subtitle {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    opacity: 0.85;
}

.form-field {
    margin-bottom: 0.75rem;
}

.form-field label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    border-radius: 999px;
    border: 1px solid rgba(11, 111, 164, 0.22);
    padding: 0.55rem 0.9rem;
    font-size: 0.9rem;
    outline: none;
    background-color: #FFFFFF;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(11, 111, 164, 0.15);
}

.form-control::placeholder {
    color: rgba(0, 0, 0, 0.35);
}

.alert.error,
.error-box {
    background: rgba(220, 53, 69, 0.08);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    font-size: 0.85rem;
    color: #7b1b27;
    border: 1px solid rgba(220, 53, 69, 0.25);
}

/* MÓDULOS EN ÁREA PRIVADA */
.profile-grid,
.profile-grid-wide {
    /* las clases se definen en perfil.php con estilos embebidos si hace falta */
}

/* LECCIONES */
.lesson-card {
    padding: 1.3rem 1.2rem 1.4rem;
}

.lesson-title {
    font-size: 1.1rem;
    margin: 0;
}

/* FOOTER */
.app-footer {
    margin-top: 2rem;
    border-top: 1px solid rgba(11, 111, 164, 0.08);
    padding: 1rem 0 1.4rem;
    background: rgba(255, 255, 255, 0.9);
}

.app-footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.app-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.8rem;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* RESPONSIVE */
@media (max-width: 840px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
        padding-top: 1.75rem;
    }

    .hero-aside {
        order: -1;
    }

    .hero-card {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .auth-card {
        padding: 1.4rem 1.25rem 1.6rem;
        border-radius: 18px;
    }

    .container {
        padding-inline: 1rem;
    }
}

@media (max-width: 640px) {
    .navbar {
        flex-direction: row;
        align-items: center;
    }

    .navbar .brand {
        flex: 1 1 auto;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        margin-top: 0.5rem;
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-links .nav-link,
    .nav-links .btn {
        width: 100%;
        justify-content: flex-start;
    }
}

/* TABLAS EN ADMIN */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.table thead {
    background: linear-gradient(90deg, rgba(11, 111, 164, 0.06), rgba(76, 207, 216, 0.06));
}

.table th,
.table td {
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid rgba(11, 111, 164, 0.1);
    text-align: left;
    white-space: nowrap;
}

.table th {
    font-weight: 600;
    color: #0B2A3F;
}

.table tbody tr:nth-child(even) {
    background: rgba(11, 111, 164, 0.02);
}

.table tbody tr:hover {
    background: rgba(11, 111, 164, 0.06);
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.badge-pill.free {
    background: rgba(177, 255, 189, 0.6);
    color: #146b26;
}

.badge-pill.paid {
    background: rgba(255, 215, 179, 0.6);
    color: #8a4b0c;
}

.link-danger {
    color: #b02a37;
    text-decoration: none;
    font-size: 0.82rem;
}

.link-danger:hover {
    text-decoration: underline;
}