@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=Nunito:wght@400;500;600;700&display=swap');

/* ============= Variables ============= */
:root {
  --blue-dark:    #1E3A5F;
  --blue-mid:     #2563EB;
  --blue-soft:    #3B82F6;
  --blue-light:   #DBEAFE;
  --blue-pale:    #EFF6FF;

  --gray-50:      #F8FAFC;
  --gray-100:     #F1F5F9;
  --gray-200:     #E2E8F0;
  --gray-400:     #94A3B8;
  --gray-600:     #475569;
  --gray-700:     #334155;

  --color-error:   #EF4444;
  --color-success: #10B981;
  --white:         #FFFFFF;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Nunito', 'Segoe UI', sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.07);
  --shadow-md:    0 4px 20px rgba(30,58,95,.10);
  --shadow-lg:    0 12px 40px rgba(30,58,95,.14);
  --shadow-focus: 0 0 0 3px rgba(37,99,235,.25);

  --t: 0.25s ease;
  --nav-h: 68px;
  --max-w: 1100px;
}

/* ============= Reset ============= */
*, *::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(--gray-700);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img    { display: block; max-width: 100%; }
a      { text-decoration: none; color: inherit; }
ul     { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ============= Utilidades ============= */
.container {
  width: min(var(--max-w), 100% - 2rem);
  margin-inline: auto;
}

.section-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue-mid);
  background: var(--blue-pale);
  border-radius: 100px;
  padding: .25rem .8rem;
  margin-bottom: .75rem;
}

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

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  color: var(--blue-dark);
  line-height: 1.2;
  margin-bottom: .65rem;
}

.section-desc { font-size: .93rem; color: var(--gray-600); }

/* ============= Botones ============= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .7rem 1.8rem;
  border-radius: var(--radius-sm);
  font-size: .93rem;
  font-weight: 700;
  border: 2px solid transparent;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t), box-shadow var(--t);
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue-mid);
  color: var(--white);
  border-color: var(--blue-mid);
}
.btn-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--blue-mid);
  border-color: var(--blue-mid);
}
.btn-outline:hover {
  background: var(--blue-pale);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--gray-100);
  color: var(--gray-400);
  border-color: var(--gray-200);
  cursor: not-allowed;
}

.btn-success {
  background: var(--color-success);
  color: var(--white);
  border-color: var(--color-success);
}

.btn-sm  { padding: .38rem 1rem; font-size: .82rem; }
.btn-full { width: 100%; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: .3rem .75rem;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 700;
}
.badge-success { background: #D1FAE5; color: #065F46; }

/* ============= Fade-up ============= */
.fade-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .5s ease, transform .5s ease;
}
.fade-up.visible { opacity: 1; transform: none; }

/* ============= Toast ============= */
#toastWrap {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.toast {
  background: var(--gray-700);
  color: var(--white);
  padding: .75rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .3s ease, transform .3s ease;
  max-width: 320px;
}
.toast.show           { opacity: 1; transform: none; }
.toast--success       { background: #065F46; }
.toast--error         { background: #991B1B; }
.toast--warning       { background: #92400E; }

/* ============= Navbar ============= */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  transition: box-shadow var(--t);
}
.navbar.scrolled { box-shadow: var(--shadow-md); }

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: min(var(--max-w), 100% - 2rem);
  margin-inline: auto;
  gap: 1rem;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--blue-dark);
  font-weight: 700;
  flex-shrink: 0;
}

.nav-collapse {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  justify-content: flex-end;
}

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

.nav-links a, .nav-link-plain {
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-700);
  padding: .4rem .7rem;
  border-radius: var(--radius-sm);
  transition: color var(--t), background var(--t);
}
.nav-links a:hover, .nav-link-plain:hover {
  color: var(--blue-mid);
  background: var(--blue-pale);
}

/* Separador visual entre nav-links y nav-auth */
.nav-auth {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-left: .75rem;
  border-left: 1px solid var(--gray-200);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-700);
  padding: .35rem .65rem;
  border-radius: var(--radius-sm);
  transition: background var(--t);
}
.nav-user:hover { background: var(--blue-pale); color: var(--blue-mid); }

.nav-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--blue-mid);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  flex-shrink: 0;
}

/* Hamburguesa */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: .5rem;
  z-index: 10;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--blue-dark);
  border-radius: 2px;
  transition: all var(--t);
}

/* ============= Hero ============= */
.hero {
  min-height: 100svh;
  min-height: 100vh;
  padding-top: var(--nav-h);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: linear-gradient(145deg, var(--blue-pale) 0%, var(--white) 55%);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(37,99,235,.08) 0%, transparent 65%);
  pointer-events: none;
}
.hero-content {
  position: relative; z-index: 1;
  text-align: center;
  max-width: 640px;
  padding: 4rem 1rem;
}
.hero-tag {
  display: inline-block;
  font-size: .75rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue-mid); margin-bottom: 1rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.75rem);
  color: var(--blue-dark); line-height: 1.1; margin-bottom: 1.25rem;
}
.hero-title em { font-style: italic; color: var(--blue-mid); }
.hero-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--gray-600);
  max-width: 480px; margin: 0 auto 2rem;
}
.hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.hero-blob {
  position: absolute; right: -120px; top: 50%; transform: translateY(-50%);
  width: 520px; height: 520px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-light) 0%, rgba(37,99,235,.1) 100%);
  pointer-events: none;
}

/* ============= Quienes somos ============= */
.about { padding: 6rem 0; background: var(--white); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: center;
}
.about-text h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--blue-dark); line-height: 1.25;
  margin-bottom: 1.25rem; margin-top: .5rem;
}
.about-text p { font-size: .95rem; color: var(--gray-600); margin-bottom: .8rem; }

.about-img-box {
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
}
.about-img-box svg { width: 100%; height: auto; display: block; }

/* Tarjetas de valores debajo del texto */
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}
.value-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  transition: box-shadow var(--t), transform var(--t);
}
.value-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.value-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--blue-pale);
  color: var(--blue-mid);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin: 0 auto .75rem;
}
.value-card h4 { font-size: .92rem; color: var(--blue-dark); margin-bottom: .35rem; }
.value-card p  { font-size: .82rem; color: var(--gray-600); }

/* ============= Cursos ============= */
.courses { padding: 6rem 0; background: var(--gray-50); }

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
}
.course-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: transform var(--t), box-shadow var(--t);
  display: flex; flex-direction: column;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.course-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 1rem; flex-shrink: 0;
}
.course-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem; color: var(--blue-dark); margin-bottom: .4rem;
}
.course-desc {
  font-size: .88rem; color: var(--gray-600);
  flex: 1; margin-bottom: 1rem;
}

/* Metadatos del curso */
.course-meta {
  list-style: none;
  display: flex; flex-direction: column;
  gap: .35rem;
  margin-bottom: 1.1rem;
  padding: .75rem;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  color: var(--gray-600);
}
.course-meta li { display: flex; align-items: baseline; gap: .4rem; }
.meta-label {
  font-weight: 700; color: var(--gray-700);
  min-width: 58px; flex-shrink: 0;
}

.course-actions {
  display: flex; align-items: center;
  gap: .6rem; margin-top: auto;
  flex-wrap: wrap;
}

.no-results {
  text-align: center;
  color: var(--gray-400);
  padding: 3rem 1rem;
  font-size: .95rem;
  grid-column: 1 / -1;
}

/* ============= Modal de curso ============= */
.modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 200;
  align-items: center; justify-content: center;
}
.modal.open, .modal[style*="display: block"] {
  display: flex !important;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.72);
}
.modal-dialog {
  position: relative; z-index: 1;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  max-width: 540px; width: calc(100% - 2rem);
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: var(--gray-100); border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.1rem; color: var(--gray-600);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t);
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-700); }
.modal-icon-wrap { margin-bottom: 1rem; }
.modal-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem; color: var(--blue-dark);
  margin-bottom: .85rem;
}
.modal-body-text { font-size: .92rem; color: var(--gray-700); line-height: 1.7; }
.modal-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .75rem; margin-top: 1.25rem;
}
.mig-item {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: .7rem .9rem;
  display: flex; flex-direction: column; gap: .2rem;
}
.mig-item strong { font-size: .75rem; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: .06em; }
.mig-item span   { font-size: .88rem; color: var(--gray-700); font-weight: 600; }
.modal-btn-inscribir { margin-top: 1.5rem; width: 100%; }

/* ============= Horarios ============= */
.schedule { padding: 6rem 0; background: var(--white); }
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}
.schedule-table {
  width: 100%; border-collapse: collapse;
  font-size: .9rem; min-width: 480px;
}
.schedule-table thead tr { background: var(--blue-dark); color: var(--white); }
.schedule-table th {
  padding: 1rem 1.25rem; text-align: left;
  font-weight: 700; font-size: .82rem; letter-spacing: .04em;
}
.schedule-table td {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
}
.schedule-table tbody tr:last-child td { border-bottom: none; }
.schedule-table tbody tr:nth-child(even) { background: var(--gray-50); }
.schedule-table tbody tr:hover { background: var(--blue-pale); }
.course-dot {
  display: inline-block;
  width: 10px; height: 10px; border-radius: 50%;
  margin-right: .6rem; vertical-align: middle;
}
.dot-math { background: #2563EB; }
.dot-sci  { background: #10B981; }
.dot-hist { background: #F59E0B; }
.dot-eng  { background: #8B5CF6; }
.dot-prog { background: #DC2626; }
.dot-lect { background: #BE185D; }

/* ============= Galeria ============= */
.gallery { padding: 6rem 0; background: var(--gray-50); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius-md); overflow: hidden;
  cursor: pointer; aspect-ratio: 4/3;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t);
}
.gallery-item:hover, .gallery-item:focus-visible {
  transform: scale(1.02); box-shadow: var(--shadow-lg);
  outline: 3px solid var(--blue-mid);
}
.gallery-img {
  width: 100%; height: 100%;
  background-size: cover; background-position: center;
  transition: transform .4s ease;
}
.gallery-item:hover .gallery-img { transform: scale(1.07); }
.gi-1 { background-image: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQhRGYjYifE11tkMuwq87S_u1qSsR4VhGfk9w&s"); }
.gi-2 { background-image: url("https://cbb.edu.pe/wp-content/uploads/2023/10/laboratorios-escolares-en-lima-peru.jpg"); }
.gi-3 { background-image: url("https://britanico.edu.pe/be-britanico/wp-content/uploads/sites/5/2019/11/clases-ingles-adultos-lima-britanico.jpg"); }
.gi-4 { background-image: url("https://unapizcadeeducacion.com/wp-content/uploads/2017/11/20170222_124854.jpg"); }
.gallery-overlay {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.48);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--t);
}
.gallery-item:hover .gallery-overlay,
.gallery-item:focus-visible .gallery-overlay { opacity: 1; }
.gallery-overlay span {
  color: var(--white); font-weight: 700; font-size: .85rem;
  border: 2px solid rgba(255,255,255,.75);
  padding: .35rem 1rem; border-radius: 100px;
}

/* ============= Lightbox ============= */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  visibility: hidden; opacity: 0;
  transition: opacity .3s ease, visibility .3s ease;
}
.lightbox.open { visibility: visible; opacity: 1; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.88); }
.lightbox-inner { position: relative; z-index: 1; text-align: center; max-width: 90vw; }
.lightbox-img-wrap {
  width: clamp(260px, 60vw, 700px); aspect-ratio: 4/3;
  border-radius: var(--radius-md); overflow: hidden; margin: 0 auto;
}
.lightbox-img { width: 100%; height: 100%; background-size: cover; background-position: center; }
.lightbox-caption {
  color: rgba(255,255,255,.85); margin-top: .9rem;
  font-size: .9rem; font-weight: 500;
}
.lightbox-close {
  position: absolute; top: -2.75rem; right: 0;
  background: none; border: none;
  color: var(--white); font-size: 2.2rem; line-height: 1;
  opacity: .75; transition: opacity var(--t);
}
.lightbox-close:hover { opacity: 1; }

/* ============= Testimonios ============= */
.testimonials { padding: 6rem 0; background: var(--blue-pale); }
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem; margin-bottom: 2rem;
}
.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--blue-light);
  display: flex; gap: 1rem;
}
.testimonial-avatar {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--blue-mid); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700;
}
.testimonial-body { flex: 1; }
.testimonial-text {
  font-size: .9rem; color: var(--gray-600);
  line-height: 1.7; margin-bottom: .75rem;
  font-style: italic;
}
.testimonial-author { display: flex; flex-direction: column; gap: .1rem; }
.testimonial-author strong { font-size: .88rem; color: var(--blue-dark); }
.testimonial-author span  { font-size: .78rem; color: var(--gray-400); }

/* Boton para mostrar el formulario de nuevo testimonio */
.testimonial-add-area { text-align: center; margin-top: .5rem; }
.testimonial-form-wrap {
  display: none;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  margin-top: 1.5rem;
  max-width: 560px; margin-inline: auto;
}
.testimonial-form { display: flex; flex-direction: column; gap: 1rem; }

/* ============= FAQ ============= */
.faq { padding: 6rem 0; background: var(--white); }
.faq-list {
  max-width: 720px; margin: 0 auto;
  display: flex; flex-direction: column; gap: .7rem;
}
.faq-item {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md); overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t);
}
.faq-item.open { border-color: var(--blue-light); box-shadow: var(--shadow-md); }
.faq-question {
  width: 100%; background: var(--white); border: none;
  padding: 1.1rem 1.25rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  text-align: left; font-weight: 600; font-size: .93rem;
  color: var(--blue-dark); transition: background var(--t);
}
.faq-question:hover { background: var(--blue-pale); }
.faq-question:focus-visible { outline: 2px solid var(--blue-mid); outline-offset: -2px; }
.faq-icon {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--blue-pale); color: var(--blue-mid);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; font-weight: 400;
  transition: transform .3s ease, background .3s ease, color .3s ease;
}
.faq-item.open .faq-icon { transform: rotate(45deg); background: var(--blue-mid); color: var(--white); }
.faq-answer { overflow: hidden; max-height: 0; transition: max-height .4s ease; }
.faq-answer-inner {
  padding: 0 1.25rem 1.1rem;
  font-size: .9rem; color: var(--gray-600); line-height: 1.7;
}

/* ============= Contacto ============= */
.contact-section { padding: 6rem 0; background: var(--gray-50); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem; align-items: start;
}
.contact-info h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--blue-dark); margin-bottom: 1rem; margin-top: .5rem;
}
.contact-info p { font-size: .93rem; color: var(--gray-600); margin-bottom: 1.5rem; }
.contact-detail {
  display: flex; flex-direction: column; gap: .7rem;
}
.contact-detail-item {
  display: flex; align-items: center; gap: .65rem;
  font-size: .9rem; color: var(--gray-700);
}
.contact-detail-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--blue-pale); color: var(--blue-mid);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
}
.contact-form-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}
.contact-form { display: flex; flex-direction: column; gap: 1.2rem; }
.contact-success {
  display: none;
  background: #D1FAE5; color: #065F46;
  border: 1px solid #6EE7B7;
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  font-size: .88rem; font-weight: 600; text-align: center;
}

/* ============= Formularios (campos compartidos) ============= */
.field-group { display: flex; flex-direction: column; gap: .4rem; }
.field-group label { font-size: .85rem; font-weight: 700; color: var(--gray-700); }
.field-group input,
.field-group select,
.field-group textarea {
  font-family: var(--font-body);
  font-size: .9rem; color: var(--gray-700);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: .65rem .9rem; width: 100%;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.field-group textarea { resize: vertical; min-height: 100px; }
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--blue-mid);
  box-shadow: var(--shadow-focus);
  background: var(--white);
}
.field-group input.error,
.field-group select.error,
.field-group textarea.error { border-color: var(--color-error); }
.field-error {
  font-size: .78rem; color: var(--color-error);
  min-height: 1em; display: block; font-weight: 600;
}

/* ============= Seccion de cursos con filtro (cursos.html) ============= */
.page-header {
  padding: 5rem 0 3rem;
  padding-top: calc(var(--nav-h) + 3.5rem);
  background: linear-gradient(145deg, var(--blue-pale) 0%, var(--white) 60%);
  text-align: center;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--blue-dark); margin-bottom: .75rem;
}
.page-header p { font-size: .95rem; color: var(--gray-600); }

.filter-section { padding: 2.5rem 0 0; background: var(--white); }
.filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0;
}
.filter-tabs { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; }
.filter-btn {
  background: none; border: 1.5px solid var(--gray-200);
  padding: .38rem 1rem; border-radius: 100px;
  font-size: .82rem; font-weight: 700; color: var(--gray-600);
  transition: all var(--t);
}
.filter-btn:hover  { border-color: var(--blue-mid); color: var(--blue-mid); }
.filter-btn.active { background: var(--blue-mid); border-color: var(--blue-mid); color: var(--white); }
.search-wrap {
  position: relative; flex-shrink: 0;
}
.search-wrap svg {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); pointer-events: none;
}
.search-input {
  font-family: var(--font-body);
  font-size: .88rem; color: var(--gray-700);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: 100px;
  padding: .45rem 1rem .45rem 2.25rem;
  outline: none; width: 220px;
  transition: border-color var(--t), box-shadow var(--t);
}
.search-input:focus {
  border-color: var(--blue-mid); box-shadow: var(--shadow-focus);
}
.cursos-main { padding: 2.5rem 0 6rem; background: var(--white); }

/* ============= Auth (login / registro) ============= */
.auth-section {
  min-height: 100vh;
  padding-top: var(--nav-h);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--blue-pale) 0%, var(--white) 60%);
  padding-bottom: 3rem;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  width: 100%; max-width: 440px;
}
.auth-logo {
  font-family: var(--font-display);
  font-size: 1.3rem; color: var(--blue-dark);
  font-weight: 700; text-align: center;
  margin-bottom: 1.75rem;
}
.auth-tabs {
  display: flex; gap: 0;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden; margin-bottom: 1.75rem;
}
.tab-btn {
  flex: 1; background: none; border: none;
  padding: .65rem;
  font-size: .88rem; font-weight: 700;
  color: var(--gray-600);
  transition: background var(--t), color var(--t);
}
.tab-btn.active {
  background: var(--blue-mid); color: var(--white);
}
.tab-content { display: none; }
.tab-content.active { display: flex; flex-direction: column; gap: 1.1rem; }
.auth-footer {
  text-align: center; margin-top: 1.25rem;
  font-size: .83rem; color: var(--gray-600);
}
.auth-footer a { color: var(--blue-mid); font-weight: 700; }
.auth-footer a:hover { text-decoration: underline; }
.auth-success {
  background: #D1FAE5; color: #065F46;
  border: 1px solid #6EE7B7; border-radius: var(--radius-sm);
  padding: .85rem 1rem; font-size: .88rem; font-weight: 600;
  text-align: center; display: none;
}

/* ============= Perfil / Dashboard ============= */
.profile-section {
  padding-top: calc(var(--nav-h) + 3rem);
  padding-bottom: 5rem;
  background: var(--gray-50);
  min-height: 100vh;
}
.profile-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem; align-items: start;
}
.profile-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  text-align: center;
}
.profile-avatar-big {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--blue-mid); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700;
  margin: 0 auto 1rem;
}
.profile-name {
  font-family: var(--font-display);
  font-size: 1.3rem; color: var(--blue-dark); margin-bottom: .25rem;
}
.profile-email { font-size: .85rem; color: var(--gray-400); margin-bottom: 1.25rem; }
.profile-meta {
  display: flex; flex-direction: column; gap: .5rem;
  border-top: 1px solid var(--gray-200); padding-top: 1.25rem;
  text-align: left; margin-bottom: 1.5rem;
}
.profile-meta-item {
  display: flex; justify-content: space-between;
  font-size: .83rem;
}
.profile-meta-item span:first-child { color: var(--gray-400); }
.profile-meta-item span:last-child  { color: var(--gray-700); font-weight: 600; }
.profile-main-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}
.profile-main-card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem; color: var(--blue-dark);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}
.enrolled-list { display: flex; flex-direction: column; gap: .75rem; }
.enrolled-item {
  display: flex; align-items: center;
  gap: 1rem; padding: 1rem 1.25rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: box-shadow var(--t);
}
.enrolled-item:hover { box-shadow: var(--shadow-sm); }
.enrolled-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.enrolled-info { flex: 1; }
.enrolled-info strong { display: block; font-size: .92rem; color: var(--blue-dark); }
.enrolled-info span  { font-size: .8rem; color: var(--gray-400); }
.enrolled-remove {
  background: none; border: none;
  color: var(--gray-400); font-size: .78rem; font-weight: 600;
  padding: .3rem .6rem;
  border-radius: var(--radius-sm);
  transition: background var(--t), color var(--t);
}
.enrolled-remove:hover { background: #FEE2E2; color: var(--color-error); }
.enrolled-empty {
  text-align: center; padding: 3rem 1rem;
  color: var(--gray-400); font-size: .93rem;
}
.enrolled-empty a { color: var(--blue-mid); font-weight: 700; }
.enrolled-empty a:hover { text-decoration: underline; }

/* ============= Footer ============= */
.footer {
  background: var(--blue-dark);
  color: rgba(255,255,255,.65);
  padding: 3.5rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem; color: var(--white);
  font-weight: 700; margin-bottom: .6rem;
}
.footer-brand-desc { font-size: .83rem; max-width: 240px; line-height: 1.6; }
.footer-col h4 {
  font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.45); margin-bottom: 1rem;
}
.footer-links { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a {
  font-size: .85rem; color: rgba(255,255,255,.65);
  transition: color var(--t);
}
.footer-links a:hover { color: var(--white); }
.footer-social { display: flex; gap: .75rem; margin-top: .25rem; }
.footer-social a {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: rgba(255,255,255,.65);
  transition: background var(--t), color var(--t);
}
.footer-social a:hover { background: rgba(255,255,255,.18); color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.5rem; text-align: center;
  font-size: .8rem;
}

/* ============= Responsive ============= */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-image { order: -1; }
  .values-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .profile-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .modal-info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-collapse {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    transform: translateY(-110%);
    transition: transform .3s ease;
    pointer-events: none;
    z-index: 90;
    gap: 0;
  }
  .nav-collapse.open { transform: translateY(0); pointer-events: all; }
  .nav-links { flex-direction: column; gap: .2rem; }
  .nav-links a { width: 100%; padding: .6rem .75rem; }
  .nav-auth {
    border-left: none;
    border-top: 1px solid var(--gray-200);
    padding-left: 0; padding-top: .75rem; margin-top: .5rem;
    flex-direction: row; flex-wrap: wrap;
  }
  .nav-user { padding: .5rem .75rem; }
  .hero-blob { display: none; }
  .values-grid { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .courses-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .filter-controls { flex-direction: column; align-items: flex-start; }
  .search-input { width: 100%; }
  .search-wrap { width: 100%; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .profile-main-card, .profile-card { padding: 1.5rem 1.25rem; }
}
