
/* --- VARIABLES Y RESET --- */
:root {
	--primary: #0a1f44; /* Azul Marino Profundo */
	--secondary: #c5a059; /* Dorado Elegante */
	--text-dark: #333;
	--text-light: #f4f4f4;
	--white: #ffffff;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

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

body {
	font-family: 'Poppins', sans-serif;
	color: var(--text-dark);
	overflow-x: hidden;
	background-color: #f9f9f9;
}

body.no-scroll {
	overflow: hidden;
}

h1, h2, h3 {
	font-family: 'Playfair Display', serif;
}

a {
	text-decoration: none;
	color: inherit;
}

/* --- NAVBAR --- */
header {
	background-color: var(--primary);
	color: var(--white);
	padding: 1rem 5%;
	position: fixed;
	width: 100%;
	top: 0;
	z-index: 1000;
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-shadow: 0 4px 15px rgba(0,0,0,0.1);
	transition: all 0.3s ease;
}

header.scrolled {
	padding: 0.5rem 5%;
	background-color: rgba(10, 31, 68, 0.95);
}

.nav-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	border: 1px solid rgba(255,255,255,0.25);
	background: rgba(255,255,255,0.06);
	color: var(--white);
	cursor: pointer;
	transition: transform 0.15s ease, background 0.15s ease;
}

.nav-toggle:active {
	transform: scale(0.98);
}

.nav-toggle-icon {
	position: relative;
	width: 18px;
	height: 2px;
	background: var(--white);
	display: block;
	border-radius: 2px;
	box-shadow: 0 -6px 0 var(--white), 0 6px 0 var(--white);
}

.mobile-nav-overlay {
	display: none;
}

.nav-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* El botón de Aula solo se muestra con sesión iniciada */
.btn-aula { display: none; }
body.is-auth .nav-actions .btn-aula,
body.is-auth .mobile-nav-actions .btn-aula { display: inline-flex; }

/* Botones de panel Admin / Maestro: ocultos por defecto, visibles con rol */
.btn-panel { display: none; }
body.is-role-admin .nav-actions .btn-admin-panel,
body.is-role-admin .mobile-nav-actions .btn-admin-panel { display: inline-flex; }
body.is-role-teacher .nav-actions .btn-teacher-panel,
body.is-role-teacher .mobile-nav-actions .btn-teacher-panel { display: inline-flex; }

.btn.btn-accent {
	background: var(--secondary);
	color: var(--primary);
	border: 2px solid var(--secondary);
	font-weight: 600;
}
.btn.btn-accent:hover {
	background: transparent;
	color: var(--secondary);
}

.btn-logout { display: none; }

body.is-auth .nav-actions .btn-login,
body.is-auth .nav-actions .btn-register,
body.is-auth .mobile-nav-actions .btn-login,
body.is-auth .mobile-nav-actions .btn-register {
	display: none;
}

body.is-auth .nav-actions .btn-logout,
body.is-auth .mobile-nav-actions .btn-logout {
	display: inline-flex;
}

.btn.btn-outline {
	background: transparent;
	color: var(--white);
	border: 2px solid var(--white);
	padding: 8px 18px;
	border-radius: 50px;
	font-size: 0.85rem;
}

/* En páginas con fondo claro (p.ej. submódulos del aula), el outline blanco se ve invisible */
.aula-page .module-actions .btn.btn-outline {
	color: var(--primary);
	border-color: var(--primary);
}

.aula-page .module-actions .btn.btn-outline:hover {
	background-color: var(--primary);
	color: var(--white);
	border-color: var(--primary);
	box-shadow: none;
	transform: translateY(-2px);
}

.btn.btn-solid {
	background: var(--secondary);
	color: var(--primary);
	border: 2px solid var(--secondary);
	padding: 8px 18px;
	border-radius: 50px;
	font-size: 0.85rem;
}

.btn.btn-outline:hover,
.btn.btn-solid:hover {
	transform: translateY(-2px);
}

.logo {
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: 1px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.logo img {
	width: 38px;
	height: 38px;
	object-fit: contain;
}

nav ul {
	display: flex;
	list-style: none;
	gap: 30px;
}

nav a {
	font-size: 0.9rem;
	font-weight: 500;
	transition: color 0.3s;
	position: relative;
}

nav a::after {
	content: '';
	position: absolute;
	width: 0;
	height: 2px;
	bottom: -5px;
	left: 0;
	background-color: var(--secondary);
	transition: width 0.3s;
}

nav a:hover::after {
	width: 100%;
}

/* --- HERO SECTION --- */
.hero {
	position: relative;
	height: 100vh;
	background: linear-gradient(rgba(10, 31, 68, 0.7), rgba(10, 31, 68, 0.7)), url('https://images.unsplash.com/photo-1523050854058-8df90110c9f1?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
	background-size: cover;
	background-position: center;
	background-attachment: fixed;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	color: var(--white);
	padding: 0 20px;
}

.hero-logo {
	position: absolute;
	width: 220px;
	height: 220px;
	object-fit: contain;
	opacity: 0.7;
	filter: blur(0px);
	animation: logoBlur 2.2s ease forwards;
	z-index: 0;
}

.hero h1,
.hero p,
.hero .btn {
	position: relative;
	z-index: 1;
}

@keyframes logoBlur {
	0% {
		opacity: 1;
		filter: blur(0px);
	}
	100% {
		opacity: 0.6;
		filter: blur(6px);
	}
}

.hero h1 {
	font-size: 4rem;
	margin-bottom: 20px;
	text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero p {
	font-size: 1.5rem;
	max-width: 700px;
	margin-bottom: 40px;
	font-weight: 300;
}

.btn {
	padding: 15px 40px;
	background-color: var(--secondary);
	color: var(--primary);
	font-weight: 600;
	border-radius: 50px;
	transition: transform 0.3s, box-shadow 0.3s;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.btn:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 20px rgba(197, 160, 89, 0.4);
	background-color: #d4b06a;
}

/* --- FRASE CÉLEBRE --- */
.quote-section {
	padding: 80px 10%;
	background-color: var(--white);
	text-align: center;
}

.quote-box {
	border-left: 5px solid var(--secondary);
	padding-left: 30px;
	display: inline-block;
}

.quote-text {
	font-size: 1.8rem;
	font-style: italic;
	color: var(--primary);
	font-family: 'Playfair Display', serif;
}

.quote-author {
	margin-top: 20px;
	display: block;
	font-weight: 600;
	color: var(--secondary);
}

/* --- NIVELES ACADÉMICOS --- */
.programs {
	padding: 100px 10%;
	background-color: #f4f4f4;
}

.section-title {
	text-align: center;
	margin-bottom: 60px;
	font-size: 2.5rem;
	color: var(--primary);
}

.cards-container {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 30px;
}

.card {
	background: var(--white);
	border-radius: 15px;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(0,0,0,0.05);
	transition: transform 0.3s, box-shadow 0.3s;
	cursor: pointer;
}

.card:hover {
	transform: translateY(-10px);
	box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.card-img {
	height: 200px;
	background-size: cover;
	background-position: center;
}

.card-content {
	padding: 30px;
	text-align: center;
}

.card-content h3 {
	color: var(--primary);
	margin-bottom: 15px;
	font-size: 1.5rem;
}

.card-content p {
	color: #666;
	margin-bottom: 20px;
	font-size: 0.9rem;
	line-height: 1.6;
}

.link-text {
	color: var(--secondary);
	font-weight: 600;
	font-size: 0.9rem;
}

/* --- FOOTER --- */
footer {
	background-color: var(--primary);
	color: var(--white);
	padding: 60px 10% 20px;
}

.footer-content {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 40px;
	margin-bottom: 40px;
}

.footer-section h4 {
	color: var(--secondary);
	margin-bottom: 20px;
	font-size: 1.2rem;
}

.footer-section p, .footer-section li {
	font-size: 0.9rem;
	margin-bottom: 10px;
	opacity: 0.8;
	list-style: none;
}

.social-icons a {
	color: var(--white);
	font-size: 1.2rem;
	margin-right: 15px;
	transition: color 0.3s;
}

.social-icons a:hover {
	color: var(--secondary);
}

.copyright {
	text-align: center;
	border-top: 1px solid rgba(255,255,255,0.1);
	padding-top: 20px;
	font-size: 0.8rem;
	opacity: 0.6;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
	.hero h1 { font-size: 2.5rem; }
	.hero { background-attachment: scroll; }
	header { padding: 0.75rem 4%; }
	header.scrolled { padding: 0.55rem 4%; }

	.logo {
		font-size: 1.05rem;
		letter-spacing: 0.5px;
		gap: 8px;
		min-width: 0;
	}

	.logo img {
		width: 30px;
		height: 30px;
	}

	nav ul { gap: 12px; }

	.btn.btn-outline,
	.btn.btn-solid {
		padding: 7px 14px;
		font-size: 0.82rem;
	}

	.quote-text { font-size: 1.4rem; }

	/* Modo compacto + overlay (solo cuando JS agrega body.js-nav) */
	body.js-nav header { flex-wrap: nowrap; gap: 10px; }
	body.js-nav nav,
	body.js-nav .nav-actions { display: none; }
	body.js-nav .nav-toggle { display: inline-flex; }

	body.js-nav.nav-overlay-open .mobile-nav-overlay {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 999;
	}

	body.js-nav .mobile-nav-backdrop {
		position: fixed;
		inset: 0;
		background: rgba(0,0,0,0.35);
	}

	body.js-nav .mobile-nav-sheet {
		position: fixed;
		top: var(--header-h, 64px);
		left: 0;
		right: 0;
		max-height: calc(100vh - var(--header-h, 64px));
		overflow: auto;
		background: rgba(10, 31, 68, 0.98);
		backdrop-filter: blur(10px);
		padding: 10px 4% 14px;
		border-top: 1px solid rgba(255,255,255,0.12);
	}

	body.js-nav .mobile-nav-links ul {
		list-style: none;
		display: flex;
		flex-direction: column;
		gap: 0;
		width: 100%;
	}

	body.js-nav .mobile-nav-links a {
		display: block;
		padding: 12px 10px;
		color: #f3d58a;
		font-weight: 600;
		border-bottom: 1px solid rgba(255,255,255,0.12);
	}

	body.js-nav .mobile-nav-links a:hover {
		color: var(--secondary);
		background: rgba(255,255,255,0.06);
	}

	body.js-nav .mobile-nav-links a:active {
		background: rgba(255,255,255,0.10);
	}

	body.js-nav .mobile-nav-actions {
		display: flex;
		flex-direction: column;
		gap: 10px;
		padding-top: 12px;
	}

	body.js-nav .mobile-nav-actions .btn {
		width: 100%;
		justify-content: center;
	}

	/* En modo invitado (no-auth): botones más chicos y en fila */
	body.js-nav .mobile-nav-actions.is-guest {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	body.js-nav .mobile-nav-actions.is-guest .btn {
		width: 100%;
		padding: 7px 12px;
		font-size: 0.78rem;
		letter-spacing: 0.5px;
		white-space: nowrap;
	}
}

/* --- LOGIN PAGE --- */
.login-page {
	background-image: url('https://images.unsplash.com/photo-1541339907198-e08756dedf3f?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
	background-size: cover;
	background-position: center;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 120px 20px 40px;
}

.login-page::before {
	content: '';
	position: fixed;
	top: 0; left: 0; width: 100%; height: 100%;
	background: rgba(10, 31, 68, 0.85);
	z-index: 0;
}

.login-wrapper {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 900px;
}

.login-container {
	background: var(--white);
	border-radius: 20px;
	box-shadow: 0 15px 35px rgba(0,0,0,0.5);
	overflow: hidden;
	min-height: 550px;
	display: flex;
	animation: fadeIn 1s ease;
}

.login-form {
	flex: 1;
	padding: 50px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	transition: all 0.6s ease-in-out;
}

.login-form h2 {
	font-family: 'Playfair Display', serif;
	color: var(--primary);
	font-size: 2rem;
	margin-bottom: 20px;
	text-align: center;
}

.social-container {
	margin: 20px 0;
	text-align: center;
}

.social-container a {
	border: 1px solid #ddd;
	border-radius: 50%;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	margin: 0 5px;
	height: 40px;
	width: 40px;
	color: var(--primary);
	transition: 0.3s;
}

.social-container a:hover {
	background-color: var(--secondary);
	border-color: var(--secondary);
	color: var(--white);
}

.input-group {
	position: relative;
	margin-bottom: 15px;
}

.input-group i {
	position: absolute;
	left: 15px;
	top: 50%;
	transform: translateY(-50%);
	color: #aaa;
}

.login-form input {
	width: 100%;
	padding: 12px 15px 12px 45px;
	background-color: #f4f4f4;
	border: none;
	border-radius: 8px;
	font-family: 'Poppins', sans-serif;
	outline: none;
}

.login-form select {
	width: 100%;
	padding: 12px 15px 12px 45px;
	background-color: #f4f4f4;
	border: none;
	border-radius: 8px;
	font-family: 'Poppins', sans-serif;
	outline: none;
	appearance: none;
}

.login-form button {
	background-color: var(--primary);
	color: var(--white);
	border: none;
	padding: 12px 45px;
	border-radius: 50px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	cursor: pointer;
	transition: 0.3s;
	margin-top: 20px;
	width: 100%;
}

.login-form button:hover {
	background-color: var(--secondary);
	transform: translateY(-2px);
}

.overlay-container {
	flex: 1;
	background: linear-gradient(to right, var(--primary), #162b55);
	color: var(--white);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	padding: 40px;
	position: relative;
}

.overlay-container h1 {
	font-family: 'Playfair Display', serif;
	font-size: 2.5rem;
	margin-bottom: 15px;
}

.overlay-container p {
	font-size: 0.9rem;
	margin-bottom: 30px;
	line-height: 1.5;
	opacity: 0.9;
}

.ghost-btn {
	background-color: transparent;
	border: 2px solid var(--white);
	color: var(--white);
	width: auto;
	padding: 10px 40px;
	border-radius: 50px;
	cursor: pointer;
}

.ghost-btn:hover {
	background-color: var(--white);
	color: var(--primary);
}

.home-link {
	position: fixed;
	top: 90px;
	left: 20px;
	color: #ddd;
	font-size: 0.9rem;
	z-index: 2;
}

.home-link:hover { color: var(--secondary); }

.hidden { display: none; }

.form-message {
	margin-top: 12px;
	font-size: 0.9rem;
	text-align: center;
}

.form-message.success { color: #0f7a2a; }
.form-message.error { color: #b00020; }

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

@media (max-width: 900px) {
	.login-container { flex-direction: column; min-height: auto; }
	.overlay-container { padding: 30px 20px; }
	.login-form { padding: 30px 20px; }
}

