/* ==========================================================================
   1. VARIABLES CSS (Root)
   ========================================================================== */
:root {
	--primary: #0066cc;
	--secondary: #004499;
	--accent: #ffc107;
	--success: #e8b923;
	--error: #e74c3c;
	--dark-green: #2a5a3e;
	--text: #333;
	--text-light: #666;
	--text-muted: #999;
	--light: #f8f9fa;
	--white: white;
	--shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
	--shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
	--shadow-lg: 0 6px 25px rgba(0, 0, 0, 0.09);
	--border-radius: 8px;
	--transition-fast: 0.3s ease;
	--transition-smooth: 0.4s ease;
}

/* ==========================================================================
   2. RESET Y BASE
   ========================================================================== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
	line-height: 1.6;
	color: var(--text);
	background-color: var(--light);
	scroll-behavior: smooth;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

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

/* Focus visible universal - WCAG */
*:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

/* ==========================================================================
   3. GENERAL
   ========================================================================== */
.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 2rem;
}

section {
	padding: 3.8rem 0;
}

section h2 {
	font-size: clamp(1.65rem, 4vw, 2.15rem);
	margin-bottom: 2.6rem;
	color: var(--primary);
	text-align: center;
	font-weight: 700;
}

/* ==========================================================================
   4. CABECERA Y NAVEGACIÓN
   ========================================================================== */
body {
	padding-top: 80px;
}

header {
	background: var(--white);
	box-shadow: var(--shadow-sm);
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	transition: var(--transition-fast);
	transform: translateY(0);
}

header.hidden {
	transform: translateY(-100%);
}

nav {
	max-width: 100%;
	margin: 0;
	display: flex;
	justify-content: flex-start;
	align-items: center;
	padding: 1rem 2rem;
	gap: 3rem;
}

.logo {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-shrink: 0;
}

.logo img {
	height: 50px;
	width: auto;
	max-width: 200px;
	object-fit: contain;
	object-position: center;
}

.logo-link {
	display: contents;
	text-decoration: none;
}

.logo-link:focus-visible .logo {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
	border-radius: 4px;
}

.nav-links {
	display: flex;
	gap: 2rem;
	list-style: none;
	margin-left: auto;
}

.nav-links a {
	text-decoration: none;
	color: var(--text);
	font-weight: 500;
	transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a:focus-visible {
	color: var(--primary);
}

.nav-links.mobile-menu {
	display: none;
}

.menu-toggle {
	display: none;
	flex-direction: column;
	background: none;
	border: none;
	cursor: pointer;
	padding: 5px;
	gap: 4px;
}

.menu-toggle span {
	width: 25px;
	height: 3px;
	background: #000;
	transition: 0.3s;
}

/* ==========================================================================
   5. HERO
   ========================================================================== */
.hero {
	background: linear-gradient(
		135deg,
		var(--primary) 0%,
		var(--secondary) 100%
	);
	color: var(--white);
	padding: 5.5rem 2rem 4.5rem;
	text-align: center;
	position: relative;
	overflow: hidden;
	min-height: 400px;
}

.hero-video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: inherit;
	filter: drop-shadow(0 12px 30px rgba(255, 255, 255, 0.3));
	transition: transform 0.4s ease;
	z-index: 1;
	opacity: 0.3;
	transform: scale(1.05);
}

/*
.hero-video:hover {
	transform: scale(1.04);
}*/

.hero-content {
	max-width: 800px;
	margin: 0 auto;
	position: relative;
	z-index: 2;
}

.hero-logo {
	display: block;
	margin: 0 auto 2rem auto;
	height: 195px;
	filter: drop-shadow(0 12px 30px rgba(255, 255, 255, 0.4));
	transition: transform var(--transition-smooth);
}

.hero-logo:hover,
.hero-logo:focus-within {
	transform: scale(1.04);
}

.hero h1 {
	font-size: clamp(1.95rem, 6vw, 2.65rem);
	margin-bottom: 1.1rem;
	font-weight: 700;
}

.hero p {
	font-size: 1.18rem;
	margin-bottom: 2.4rem;
	opacity: 0.96;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
}

/* CTA */
.cta-button,
.submit-btn {
	display: inline-block;
	background: var(--white);
	color: var(--primary);
	padding: 0.9rem 2.4rem;
	border-radius: 5px;
	text-decoration: none;
	font-weight: bold;
	transition: all var(--transition-fast);
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 1rem;
}

.cta-button:hover,
.cta-button:focus-visible,
.submit-btn:hover,
.submit-btn:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

/* ==========================================================================
   6. NOSOTROS
   ========================================================================== */
.about {
	background: var(--white);
}

.about-content {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2.8rem;
	align-items: start;
}

.about-text h3 {
	color: var(--primary);
	margin-bottom: 1rem;
	font-size: 1.4rem;
}

.about-text p {
	margin-bottom: 1.3rem;
	text-align: justify;
}

/* ==========================================================================
   7. VALORES
   ========================================================================== */
.values {
	background: var(--light);
}

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

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

.value-card {
	background: var(--white);
	padding: 2rem;
	border-radius: var(--border-radius);
	box-shadow: var(--shadow-sm);
	transition: transform var(--transition-fast);
	text-align: center;
}

.value-card:hover,
.value-card:focus-within {
	transform: translateY(-5px);
}

.value-card h3 {
	color: var(--primary);
	margin-bottom: 1rem;
	text-align: center;
}

/* ==========================================================================
   8. SERVICIOS
   ========================================================================== */
.services {
	background: var(--white);
}

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

.service-card {
	background: var(--light);
	padding: 2rem;
	border-radius: var(--border-radius);
	border-left: 4px solid var(--primary);
	transition: box-shadow var(--transition-fast);
}

.service-card:hover {
	box-shadow: var(--shadow-md);
}

.service-card h3 {
	color: var(--primary);
	margin-bottom: 1rem;
	font-size: 1.25rem;
	text-align: center;
}

.service-card ul {
	list-style: none;
	padding-left: 0;
}

.service-card li {
	padding: 0.55rem 0;
	padding-left: 1.6rem;
	position: relative;
}

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

.service-card p:not(:first-child) {
    text-align: center;
}

/* ==========================================================================
   9. FORMACIÓN
   ========================================================================== */
.formation {
	background: var(--light);
}

.formation-content {
	background: var(--white);
	padding: 3rem;
	border-radius: 12px;
	box-shadow: var(--shadow-md);
	margin-bottom: 2.5rem;
}

.formation-content h3 {
	color: var(--primary);
	margin-bottom: 1.4rem;
	font-size: 1.55rem;
}

.formation-content h4 {
	color: var(--primary);
	margin-bottom: 1.4rem;
	font-size: 1.3rem;
}

.formation-content p {
    text-align: justify;
	margin-bottom: 1.3rem;
	font-size: 1.06rem;
	line-height: 1.8;
	color: #444;
}

.formation-content strong {
	color: var(--primary);
}

.formation-offer {
	text-align: center;
}

.partners {
    background: var(--light);
    padding: 3rem 0;
}

.partners h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.partners-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: center;
}

.partners-logos img {
    max-height: 70px;
    max-width: 160px;
    height: auto;
    width: auto;
    object-fit: contain;
}

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

.mod-card {
	border-radius: 12px;
	padding: 30px;
	color: white;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
	transition: 0.3s;
}

.mod-card:hover {
	transform: translateY(-6px);
}

.mod-i {
	background: #1e5ed6;
}

.mod-ii {
	background: #0b3f91;
}

.mod-crea {
	background: #3c86ff;
}

.mod-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.mod-content {
	margin-top: 20px;
}

.course {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 8px;
	margin-bottom: 2rem;
	padding: 15px;
	text-align: center;
}

.course-code {
	font-weight: bold;
}

.course-title {
	font-weight: 600;
	margin: 5px 0;
}

.course-date {
	font-size: 0.9rem;
}

.apply-btn {
	display: inline-block;
	background: var(--primary);
	color: white;
	padding: 0.75rem 1.5rem;
	text-decoration: none;
	border-radius: 6px;
	font-weight: 600;
	transition: all 0.3s ease;
	margin-top: 1rem;
}

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

.subvencion {
	margin-top: 60px;
	text-align: center;
}

.subvencion h3 {
	color: #fff;
	margin-bottom: 20px;
}

.subvencion-logos {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 40px;
}

.subvencion-logos img {
	max-height: 70px;
}

/* ==========================================================================
   10. AGENCIA
   ========================================================================== */
.agency {
	background: var(--light);
}

.agency-content {
	background: var(--white);
	padding: 3.5rem;
	border-radius: 12px;
	box-shadow: var(--shadow-lg);
	max-width: 880px;
	margin: 0 auto;
}

.agency-content h3 {
	color: var(--primary);
	font-size: 1.8rem;
	text-align: center;
	margin-bottom: 1.8rem;
	font-weight: 600;
	line-height: 1.35;
}

.agency-subtitle {
	color: var(--primary);
	font-size: 1.48rem;
	margin: 2.8rem 0 1.4rem 0;
	font-weight: 600;
}

.agency-content p {
	font-size: 1.08rem;
	line-height: 1.82;
	color: #444;
	margin-bottom: 1.4rem;
	text-align: justify;
}

.agency-content ul {
	list-style: none;
	padding-left: 0;
}

.agency-content li {
	padding: 0.65rem 0;
	padding-left: 2rem;
	position: relative;
	font-size: 1.06rem;
	color: #444;
}

.agency-content li::before {
	content: "✓";
	position: absolute;
	left: 0;
	color: var(--primary);
	font-weight: bold;
	font-size: 1.2rem;
}

/* ==========================================================================
   11. FORMULARIO CONTACTO
   ========================================================================== */
.contact {
	background: var(--white);
}

.contact-content {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 3rem;
}

.contact-info {
	background: var(--light);
	padding: 2rem;
	border-radius: var(--border-radius);
}

.contact-info h3 {
	color: var(--primary);
	margin-bottom: 1.5rem;
}

.contact-info p {
	margin-bottom: 1rem;
}

.contact-info a {
	color: var(--primary);
	text-decoration: none;
}

.contact-info a:hover {
	text-decoration: underline;
}

.contact-form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.form-group {
	display: flex;
	flex-direction: column;
}

.form-group label {
	margin-bottom: 0.5rem;
	font-weight: 500;
	color: var(--text);
}

.form-group input,
.form-group textarea {
	padding: 0.8rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-family: inherit;
	font-size: 1rem;
	transition:
		border-color var(--transition-fast),
		box-shadow var(--transition-fast);
}

.form-group textarea {
	resize: vertical;
	min-height: 120px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group input:focus-visible,
.form-group textarea:focus-visible {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group:last-child label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: normal;
	margin-top: 0.5rem;
}

.form-group:has(input[type="checkbox"]) label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: normal;
	font-size: 0.95rem;
	line-height: 1.4;
	padding: 0.75rem 0;
}

.form-group:has(input[type="checkbox"]) input[type="checkbox"] {
	margin: 0;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.form-group:has(input[type="checkbox"]) .checkbox-text {
	flex: 1;
}

/* Validación */
.contact-form.was-validated .form-group input:invalid,
.contact-form.was-validated .form-group textarea:invalid {
	border-color: var(--error);
	box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.contact-form .error-message {
	color: var(--error);
	font-size: 0.875rem;
	margin-top: 0.25rem;
}

/* Submit button específico */
.submit-btn {
	background: var(--primary);
	color: var(--white);
	padding: 0.85rem 2rem;
	font-size: 1rem;
}

.submit-btn:hover,
.submit-btn:focus-visible {
	background: var(--secondary);
	transform: translateY(-2px);
}

/* ==========================================================================
   12. OPINIONES
   ========================================================================== */
.reviews {
	background: var(--white);
}

.reviews-container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	align-items: start;
}

.reviews-info {
	background: var(--light);
	padding: 2rem;
	border-radius: var(--border-radius);
}

.rating-display {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.rating-number {
	font-size: 2.5rem;
	font-weight: bold;
	color: var(--primary);
}

.stars {
	color: var(--accent);
	font-size: 1.2rem;
}

.reviews-list {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	max-height: 600px;
	overflow-y: auto;
	padding-right: 1rem;
	scrollbar-width: thin;
}

.reviews-list::-webkit-scrollbar {
	width: 6px;
}

.reviews-list::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 3px;
}

.reviews-list::-webkit-scrollbar-thumb {
	background: var(--primary);
	border-radius: 3px;
}

.review-card {
	background: var(--white);
	padding: 1.5rem;
	border-radius: var(--border-radius);
	border-left: 4px solid var(--primary);
	box-shadow: var(--shadow-sm);
	transition: box-shadow var(--transition-fast);
}

.review-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.review-header {
	display: flex;
	justify-content: space-between;
	align-items: start;
	margin-bottom: 0.5rem;
}

.review-name {
	font-weight: bold;
	color: var(--text);
}

.review-stars {
	color: var(--accent);
	font-size: 0.9rem;
}

.review-text {
	color: var(--text-light);
	font-size: 0.95rem;
	line-height: 1.5;
	margin-bottom: 0.5rem;
}

.review-date {
	color: var(--text-muted);
	font-size: 0.85rem;
}

.google-link {
	display: block;
	margin: 1.5rem auto 0;
	background: var(--primary);
	color: var(--white);
	padding: 0.8rem 1.5rem;
	border-radius: 5px;
	text-decoration: none;
	font-weight: bold;
	text-align: center;
	max-width: 280px;
	transition: background var(--transition-fast);
	box-shadow: var(--shadow-sm);
}

.google-link:hover,
.google-link:focus-visible {
	background: var(--secondary);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   13. FOOTER
   ========================================================================== */
footer {
	background: #333;
	color: var(--white);
	padding: 2.2rem;
	text-align: center;
	margin-top: 3rem;
}

footer p {
	margin-bottom: 0.5rem;
}

footer .footer-copyright {
	margin-top: 1rem;
	font-size: 0.9rem;
}

/* ==========================================================================
   14. MAPA
   ========================================================================== */
.location {
	background: var(--light);
	padding: 3rem 0;
}

.map-container {
	border-radius: var(--border-radius);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	margin-bottom: 2rem;
}

.map-container iframe {
	width: 100%;
	height: 400px;
	border: none;
	display: block;
}

.map-info {
	text-align: center;
}

.map-info p {
	color: var(--text-light);
	margin-bottom: 1rem;
	font-weight: bold;
}

/* ==========================================================================
   15. WHATSAPP Y SCROLL TO TOP
   ========================================================================== */

.whatsapp-float {
	position: fixed;
	width: 50px;
	height: 50px;
	bottom: 80px;
	right: 20px;
	background-color: #25d366;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
	z-index: 1000;
	transition: transform 0.3s;
	text-decoration: none;
}

@media screen and (max-width: 768px) {
	.whatsapp-float {
		width: 27px;
		height: 27px;
		bottom: 40px;
		right: 7px;
	}
}

.whatsapp-float:hover {
	transform: scale(1.1);
}

.scroll-top {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 50px;
	height: 50px;
	border: none;
	border-radius: 50%;
	background: #007bff;
	color: white;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
	z-index: 1001;
	box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.scroll-top:hover {
	background: #0056b3;
	transform: scale(1.1);
}

.scroll-top.show {
	opacity: 1;
	visibility: visible;
}

@media screen and (max-width: 768px) {
	.scroll-top {
		width: 27px;
		height: 27px;
		bottom: 7px;
		right: 7px;
	}
}

/* ==========================================================================
   16. MEDIA QUERIES - MOBILE FIRST
   ========================================================================== */
/* Mobile: hasta 480px */
@media (max-width: 480px) {
	header,
	nav {
		position: static !important;
		top: auto !important;
	}

	body {
		padding-top: 0 !important;
	}

	.nav-links.mobile-menu {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}
}

/* Mobile: hasta 768px */
@media (max-width: 768px) {
	nav {
		flex-direction: column;
		gap: 1rem;
		padding: 1rem;
	}

	.nav-links {
		gap: 1rem;
		font-size: 0.9rem;
		margin-left: 0;
		order: 2;
	}

	.nav-links.desktop-menu {
		display: none;
	}

	.nav-links.mobile-menu {
		display: none;
	}

	.nav-links.mobile-menu.open {
		display: flex;
	}

	.menu-toggle {
		display: flex;
		position: absolute;
		right: 10px;
		top: 25px;
	}

	.menu-toggle[aria-expanded="true"] span:nth-child(2) {
		opacity: 0;
	}

	.logo {
		order: 1;
	}

	.hero {
		padding: 4rem 1.5rem 3.5rem;
	}

	.about-content,
	.contact-content,
	.reviews-container {
		grid-template-columns: 1fr;
		gap: 2rem;
	}

	.reviews-list {
		max-height: none;
	}

	.map-container iframe {
		height: 300px;
	}

	.agency-content,
	.formation-content {
		padding: 2.2rem 1.5rem;
	}

	.mod-container {
		grid-template-columns: 1fr;
	}

	.container {
		padding: 0 1rem;
	}

	.google-link {
		max-width: 100%;
		margin: 1rem auto 0;
	}
}

/* Tablet: 769px - 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
	.services-grid {
		grid-template-columns: 1fr 1fr;
	}
}

/* Animaciones suaves */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}
