/* Jhon Jurídico — Derecho para Todos
   Paleta y tipografía heredadas de la identidad de marca existente. */

:root {
  --navy: 222 47% 20%;
  --navy-dark: 222 50% 12%;
  --navy-light: 222 40% 35%;
  --gold: 35 50% 48%;
  --gold-light: 38 48% 56%;
  --gold-dark: 30 45% 38%;
  --emerald: 160 84% 39%;
  --cream: 40 20% 98%;
  --cream-warm: 38 30% 94%;
  --gray-light: 40 20% 96%;
  --ink: 220 30% 18%;
  --ink-muted: 220 15% 45%;
  --radius: 14px;
  --shadow-md: 0 4px 12px -2px hsl(220 30% 18% / .12), 0 2px 6px -2px hsl(220 30% 18% / .08);
  --shadow-lg: 0 12px 24px -4px hsl(220 30% 18% / .15), 0 6px 12px -6px hsl(220 30% 18% / .1);
  --shadow-gold: 0 12px 40px -8px hsl(var(--gold) / .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: hsl(var(--cream));
  color: hsl(var(--ink));
  font-family: 'Inter', -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-display {
  font-family: 'Playfair Display', Georgia, serif;
  color: hsl(var(--navy));
  line-height: 1.2;
  margin: 0 0 .5em;
}

p { margin: 0 0 1em; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(var(--cream) / .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid hsl(var(--navy) / .08);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand img { width: 40px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: hsl(var(--navy));
}
.brand-text span {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: hsl(var(--gold-dark));
  font-weight: 600;
}
.main-nav { display: flex; align-items: center; gap: 32px; }
.main-nav a {
  text-decoration: none;
  color: hsl(var(--ink));
  font-weight: 500;
  font-size: .95rem;
  transition: color .2s;
}
.main-nav a:hover { color: hsl(var(--gold-dark)); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn-gold {
  background: linear-gradient(135deg, hsl(var(--gold-light)), hsl(var(--gold-dark)));
  color: #fff;
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover { transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  color: hsl(var(--navy));
  border: 1.5px solid hsl(var(--navy) / .25);
}
.btn-outline:hover { border-color: hsl(var(--navy)); }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, hsl(var(--navy)) 0%, hsl(var(--navy-dark)) 100%);
  color: hsl(40 20% 96%);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(hsl(var(--gold) / .18) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .5;
}
.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
  align-items: center;
  padding: 4px 24px 56px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: hsl(var(--gold) / .15);
  border: 1px solid hsl(var(--gold) / .4);
  color: hsl(var(--gold-light));
  padding: 6px 16px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .03em;
  margin-bottom: 20px;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  margin-bottom: .4em;
}
.hero h1 em {
  font-style: normal;
  color: hsl(var(--gold-light));
}
.hero p.lead {
  font-size: 1.15rem;
  color: hsl(40 20% 88%);
  max-width: 46ch;
}
.hero-cta { display: flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid hsl(0 0% 100% / .12);
}
.hero-stats div strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: hsl(var(--gold-light));
}
.hero-stats div span { font-size: .82rem; color: hsl(40 20% 78%); }

.hero-portrait {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px -12px hsl(0 0% 0% / .5);
  border: 1px solid hsl(0 0% 100% / .1);
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/5; }
.hero-portrait .tag {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  background: hsl(var(--navy-dark) / .85);
  backdrop-filter: blur(6px);
  border: 1px solid hsl(var(--gold) / .3);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .85rem;
  color: hsl(40 20% 92%);
}

/* ---------- Sections ---------- */
section { padding: 88px 0; }
.section-kicker {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .78rem;
  font-weight: 700;
  color: hsl(var(--gold-dark));
  margin-bottom: 10px;
}
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-head p { color: hsl(var(--ink-muted)); font-size: 1.05rem; }
.bg-warm { background: linear-gradient(180deg, hsl(var(--cream)) 0%, hsl(var(--cream-warm)) 100%); }
.bg-navy { background: hsl(var(--navy-dark)); color: hsl(40 20% 90%); }
.bg-navy .section-head h2 { color: #fff; }

/* ---------- Course cards ---------- */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }

/* Catalogo: tarjetas de ancho fijo, no se estiran cuando hay pocos cursos */
.courses-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 240px));
  justify-content: center;
  gap: 22px;
}

/* ---------- Course slider (home) ---------- */
.courses-slider-wrap { position: relative; }
.courses-slider {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.courses-slider::-webkit-scrollbar { display: none; }
.course-slide { flex: 0 0 calc(25% - 15px); scroll-snap-align: start; min-width: 200px; }
.slider-dots { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
.slider-dots button {
  width: 10px; height: 10px; border-radius: 999px; border: none; padding: 0;
  background: hsl(var(--navy) / .18); cursor: pointer; transition: all .2s ease;
}
.slider-dots button.active { background: hsl(var(--gold-dark)); width: 28px; }

@media (max-width: 960px) {
  .course-slide { flex: 0 0 calc(33.333% - 13px); }
}
@media (max-width: 640px) {
  .course-slide { flex: 0 0 62%; }
}
.course-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform .22s ease, box-shadow .22s ease;
  display: flex;
  flex-direction: column;
}
.course-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.course-card .thumb { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.course-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-card .badge {
  position: absolute; top: 10px; left: 10px;
  background: hsl(var(--gold-dark)); color: #fff;
  font-size: .64rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  letter-spacing: .04em; text-transform: uppercase;
}
.course-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.course-card h3 { font-size: 1rem; margin: 0; line-height: 1.3; }
.course-card .desc {
  color: hsl(var(--ink-muted)); font-size: .82rem; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-card .price-row { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.price-now { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 700; color: hsl(var(--navy)); }
.price-before { text-decoration: line-through; color: hsl(var(--ink-muted)); font-size: .9rem; }
.course-card .body .btn { padding: 8px 16px; font-size: .82rem; }

/* ---------- Value props ---------- */
.value-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.value-card {
  background: #fff; border-radius: var(--radius); padding: 30px 26px;
  box-shadow: var(--shadow-md);
}
.value-card .icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, hsl(var(--gold-light)), hsl(var(--gold-dark)));
  display: flex; align-items: center; justify-content: center;
  color: #fff; margin-bottom: 16px; font-size: 1.3rem;
}
.value-card h3 { font-size: 1.1rem; }
.value-card p { color: hsl(var(--ink-muted)); font-size: .92rem; margin: 0; }

/* ---------- Testimonials ---------- */
.testi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.testi-card {
  background: hsl(var(--navy-light) / .18);
  border: 1px solid hsl(0 0% 100% / .08);
  border-radius: var(--radius);
  padding: 26px;
}
.testi-card .stars { color: hsl(var(--gold-light)); letter-spacing: 2px; margin-bottom: 10px; }
.testi-card p.quote { font-size: .96rem; color: hsl(40 15% 88%); }
.testi-card .who { font-size: .85rem; color: hsl(var(--gold-light)); font-weight: 600; margin-top: 12px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact-item { display: flex; gap: 14px; margin-bottom: 20px; }
.contact-item .icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: hsl(var(--gold) / .15); color: hsl(var(--gold-dark));
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.contact-item strong { display: block; color: hsl(var(--navy)); }
.contact-item span { color: hsl(var(--ink-muted)); font-size: .92rem; }

.card-form {
  background: #fff; border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow-lg);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: hsl(var(--navy)); }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid hsl(var(--navy) / .15); font-family: inherit; font-size: .95rem;
  background: hsl(var(--cream));
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: hsl(var(--gold));
}

/* ---------- Footer ---------- */
.site-footer {
  background: hsl(var(--navy-dark)); color: hsl(40 15% 75%);
  padding: 56px 0 28px; font-size: .9rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.site-footer h4 { color: #fff; font-family: 'Playfair Display', serif; font-size: 1rem; margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { text-decoration: none; color: hsl(40 15% 75%); transition: color .2s; }
.site-footer a:hover { color: hsl(var(--gold-light)); }
.footer-bottom {
  border-top: 1px solid hsl(0 0% 100% / .08); padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: .82rem; color: hsl(40 10% 55%);
}

/* ---------- Generic pages (catalog, checkout, admin) ---------- */
.page-header { background: hsl(var(--navy)); color: #fff; padding: 56px 0 40px; }
.page-header h1 { color: #fff; margin: 0; }
.breadcrumb { font-size: .85rem; color: hsl(var(--gold-light)); margin-bottom: 10px; }
.breadcrumb a { color: hsl(var(--gold-light)); text-decoration: none; }

.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: .92rem; }
.alert-error { background: hsl(0 70% 96%); color: hsl(0 65% 35%); border: 1px solid hsl(0 60% 85%); }
.alert-success { background: hsl(160 60% 95%); color: hsl(160 60% 25%); border: 1px solid hsl(160 50% 80%); }

.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.summary-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 26px; position: sticky; top: 100px;
}
.summary-card img { border-radius: 10px; margin-bottom: 16px; aspect-ratio: 16/10; object-fit: cover; }
.summary-line { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed hsl(var(--navy) / .12); font-size: .93rem; }
.summary-total { display: flex; justify-content: space-between; padding-top: 14px; font-size: 1.2rem; font-weight: 700; color: hsl(var(--navy)); font-family: 'Playfair Display', serif; }

table.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
table.admin-table th, table.admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid hsl(var(--navy) / .08); font-size: .9rem; }
table.admin-table th { background: hsl(var(--cream-warm)); color: hsl(var(--navy)); font-weight: 700; }
.status-pill { padding: 4px 12px; border-radius: 999px; font-size: .76rem; font-weight: 700; text-transform: uppercase; }
.status-pendiente { background: hsl(40 80% 90%); color: hsl(35 60% 35%); }
.status-pagado { background: hsl(200 70% 92%); color: hsl(210 60% 35%); }
.status-matriculado { background: hsl(160 60% 92%); color: hsl(160 60% 25%); }
.status-error { background: hsl(0 70% 94%); color: hsl(0 65% 40%); }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: hsl(var(--navy-dark)); color: #fff; padding: 28px 20px; flex-shrink: 0; }
.admin-sidebar .brand-text strong, .admin-sidebar .brand-text span { color: #fff; }
.admin-sidebar nav { margin-top: 32px; display: flex; flex-direction: column; gap: 6px; }
.admin-sidebar nav a { padding: 10px 14px; border-radius: 8px; text-decoration: none; color: hsl(40 15% 80%); font-size: .92rem; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: hsl(0 0% 100% / .08); color: #fff; }
.admin-main { flex: 1; padding: 36px 40px; background: hsl(var(--cream)); }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-md); }
.stat-card strong { display: block; font-family: 'Playfair Display', serif; font-size: 1.8rem; color: hsl(var(--navy)); }
.stat-card span { font-size: .82rem; color: hsl(var(--ink-muted)); }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: hsl(var(--navy-dark)); }
.login-card { background: #fff; border-radius: var(--radius); padding: 40px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }

@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-portrait { max-width: 360px; }
  .detail-grid, .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; }
}
