@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --azul: #124C81;
  --azul-claro: #2E86C9;
  --coral: #FF6B4A;
  --fondo: #F7F5F1;
  --tinta: #1B1B18;
  --gris: #6B6963;
  --borde: #E4E1D8;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font-family: 'Inter', sans-serif; min-height: 100vh; }
h1, h2, h3 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; letter-spacing: 0.3px; margin: 0; }
a { color: inherit; }

/* ---------- Navbar ---------- */
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 32px; background: #fff; border-bottom: 1px solid var(--borde); flex-wrap: nowrap; }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 60px; display: block; }
.nav-contacto { display: flex; align-items: center; gap: 18px; margin-left: 24px; flex-shrink: 0; }
.nav-contacto a { color: var(--gris); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav-contacto .nav-tel { color: var(--azul); font-weight: 600; }
.nav-contacto a:hover { color: var(--azul); }
.navlinks { display: flex; align-items: center; gap: 18px; margin-left: auto; flex-shrink: 0; }
.navlinks a { color: var(--gris); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.navlinks a:hover { color: var(--azul); }
.saludo { font-size: 13px; color: var(--gris); }
.navlinks .btn-ingresar { background: var(--azul); color: #fff; padding: 9px 20px; border-radius: 8px; font-weight: 600; }
.navlinks .btn-ingresar:hover { background: var(--azul-claro); color: #fff; }

.flash-container { max-width: 460px; margin: 16px auto 0; padding: 0 20px; }
.flash { background: #FDECE7; color: #C24A2C; border: 1px solid #f3c9bb; padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 8px; }

/* ---------- Hero listado ---------- */
.hero { background: linear-gradient(135deg, var(--azul) 0%, var(--azul-claro) 100%); color: #fff; padding: 16px 32px 20px; }
.hero .eyebrow { text-transform: uppercase; font-size: 11px; letter-spacing: 1.5px; color: #d7f5ea; margin: 0 0 4px; font-weight: 600; }
.hero h1 { font-size: 22px; max-width: 640px; line-height: 1.15; color: #fff; }
.hero-sub { margin-top: 10px; max-width: 520px; color: #e7f7ef; font-size: 14px; line-height: 1.5; }

/* ---------- Banner slider (imagenes debajo del navbar) ---------- */
.banner-slider { position: relative; width: 100%; overflow: hidden; background: #0a1a28; }
.banner-track { width: 100%; }
.banner-slide { display: none; }
.banner-slide.banner-active { display: block; }
.banner-slide img { width: 100%; height: 380px; object-fit: cover; object-position: center; display: block; }
.banner-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.35); color: #fff; border: 0; border-radius: 50%; width: 42px; height: 42px; font-size: 18px; cursor: pointer; z-index: 2; }
.banner-btn:hover { background: rgba(0,0,0,.6); }
.banner-prev { left: 12px; }
.banner-next { right: 12px; }
.banner-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.banner-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.55); cursor: pointer; }
.banner-dot.banner-active { background: #fff; }

.header-taller { padding: 32px; background: #fff; border-bottom: 1px solid var(--borde); }
.header-taller .volver { text-decoration: none; font-size: 13px; color: var(--gris); display: inline-block; margin-bottom: 12px; }
.header-taller h1 { font-size: 30px; margin-top: 10px; }
.header-taller p { color: var(--gris); margin-top: 6px; }

/* ---------- Grid + cards con imagen ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding: 32px; margin-top: 28px; }
.card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 4px 16px rgba(27,27,24,0.06); border: 1px solid var(--borde); display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(27,27,24,0.1); }
.card-img-wrap { position: relative; }
.card-img { width: 100%; height: 150px; object-fit: cover; display: block; background: var(--borde); }
.badge-flotante { position: absolute; top: 12px; left: 12px; background: #fff; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.card-body h2 { font-size: 20px; margin-top: 2px; }
.card-body h3 { font-size: 16px; }
.card-meta { display: flex; gap: 14px; font-size: 12px; color: var(--gris); margin: 2px 0 4px; }
.categoria { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; padding: 3px 10px; border-radius: 20px; background: #E7F1FA; color: var(--azul); display: inline-block; width: fit-content; }
.cat-nutricion { background: #FDECE7; color: #C24A2C; }
.cat-psicologia { background: #EDEAFB; color: #5B48C4; }
.cat-medicina-del-deporte { background: #E7F1FA; color: var(--azul); }
.boton-card { align-self: flex-start; margin-top: 10px; text-align: center; text-decoration: none; background: var(--coral); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; display: inline-block; }
.boton-card:hover { background: #e85a3a; }
.boton-card-chico { display: inline-block; padding: 6px 14px; font-size: 12px; margin-top: 6px; }
.grid-chica { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 8px; }
.card-chica { text-decoration: none; color: inherit; }
.card-chica .card-img { height: 110px; }
.otros-talleres { margin-top: 40px; }
.otros-talleres h2 { font-size: 22px; margin-bottom: 4px; }

/* ---------- Hero oscuro del detalle del taller ---------- */
.hero-taller { background: linear-gradient(135deg, #16324A 0%, #1B4F70 100%); color: #fff; padding: 40px 32px; }
.hero-taller-inner { max-width: 1100px; margin: 0 auto; display: flex; gap: 40px; align-items: flex-start; }
.hero-taller-info { flex: 1; min-width: 0; }
.hero-taller-video { flex: 1.6; min-width: 0; min-height: 200px; }
.hero-taller .volver { color: #bcd6e6; text-decoration: none; font-size: 13px; display: inline-block; margin-bottom: 14px; }
.hero-taller .categoria { margin-bottom: 14px; }
.hero-taller h1 { font-size: 34px; color: #fff; margin-bottom: 14px; }
.hero-taller .descripcion-larga { color: #d7e6ee; font-size: 15px; line-height: 1.6; margin: 0 0 20px; }
.meta-lista { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 8px; }
.meta-lista li { font-size: 14px; color: #d7e6ee; }
.disertante-chip { display: flex; align-items: center; gap: 12px; }
.disertante-chip .avatar, .disertante-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--coral); color: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 18px; flex-shrink: 0; object-fit: cover; }
.disertante-chip strong { font-size: 14px; }
.disertante-chip p { margin: 2px 0 0; font-size: 13px; color: #bcd6e6; }
.hero-taller .video-wrapper video { box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.video-wrapper { position: relative; width: 100%; background: #0a1a28; border-radius: 14px; overflow: hidden; height: 0; padding-top: 56.25%; }
.video-wrapper video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 14px; object-fit: contain; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Detalle / formularios ---------- */
.detalle { max-width: 700px; margin: 32px auto; padding: 0 20px 60px; }
.descripcion-larga { font-size: 16px; line-height: 1.6; color: #3a3934; }
.form-registro form, .valoracion form, .consultas form { display: flex; flex-direction: column; gap: 14px; background: #fff; padding: 24px; border-radius: 14px; margin-top: 16px; border: 1px solid var(--borde); }
.form-registro h2, .valoracion h3, .consultas h3, .video-charla h2 { font-size: 22px; margin-bottom: 4px; }
.form-registro label, .valoracion label { display: flex; flex-direction: column; font-size: 13px; color: var(--gris); gap: 6px; font-weight: 500; }
.form-registro input, .form-registro select, .valoracion select, textarea { padding: 10px 12px; border: 1px solid var(--borde); border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 14px; }
.checkbox { flex-direction: row !important; align-items: center; gap: 8px !important; }
.checkbox input { width: auto; }
button { background: var(--coral); color: #fff; border: none; padding: 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; }
button:hover { background: #e85a3a; }
.disertante-info { background: #fff; padding: 20px; border-radius: 14px; border: 1px solid var(--borde); margin-bottom: 16px; }
.disertante-info h3 { font-size: 18px; }
.disertante-info p { color: var(--gris); font-size: 14px; margin: 4px 0; }
.disertante-foto { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 4px; }
.ya-enviado { background: #F1F6FB; border-radius: 10px; padding: 14px; font-size: 14px; }
.comentario-previo { color: #3a3934; font-style: italic; margin-top: 6px; }
.respuesta { margin-top: 6px; color: var(--azul); }
.pendiente { margin-top: 6px; color: var(--gris); font-size: 13px; }

/* ---------- Login / registro ---------- */
.auth-wrap { display: flex; justify-content: center; padding: 48px 20px; }
.auth-card { background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 32px; max-width: 420px; width: 100%; }
.auth-card h1 { font-size: 26px; }
.auth-sub { color: var(--gris); font-size: 14px; margin: 8px 0 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card label { display: flex; flex-direction: column; font-size: 13px; color: var(--gris); gap: 6px; font-weight: 500; }
.auth-card input, .auth-card textarea { padding: 10px 12px; border: 1px solid var(--borde); border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 14px; }
.link-secundario { font-size: 13px; color: var(--azul); text-decoration: none; align-self: flex-end; margin-top: -6px; }
.auth-divider { border-top: 1px solid var(--borde); margin: 24px 0 16px; }
.auth-footer { font-size: 14px; color: var(--gris); margin-bottom: 10px; }
.boton-secundario { display: block; text-align: center; text-decoration: none; border: 1.5px solid var(--azul); color: var(--azul); padding: 10px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.boton-secundario:hover { background: #E7F1FA; }
.dev-box { margin-top: 18px; background: #FFF8E6; border: 1px solid #F0DDA0; padding: 14px; border-radius: 8px; font-size: 13px; word-break: break-all; }
.dev-box a { color: var(--azul); }

/* ---------- Dashboard / admin ---------- */
.dashboard { padding: 32px; }
.kpis { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.kpi { background: #fff; padding: 18px 28px; border-radius: 14px; text-align: center; border: 1px solid var(--borde); min-width: 160px; font-size: 13px; color: var(--gris); }
.kpi span { display: block; font-family: 'Barlow Condensed', sans-serif; font-size: 32px; font-weight: 700; color: var(--azul); }
.tabla-talleres { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--borde); }
.tabla-talleres th { background: var(--tinta); color: #fff; text-align: left; padding: 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.tabla-talleres td { padding: 12px; border-bottom: 1px solid var(--borde); font-size: 14px; }
.navbar-admin { background: var(--tinta); }
.brand-admin { color: #fff; font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 700; }
.brand-admin span { color: var(--coral); font-weight: 500; font-size: 14px; margin-left: 8px; }
.navbar-admin .navlinks { display: flex; align-items: center; gap: 8px; }
.navbar-admin .navlinks a, .navbar-admin .saludo { color: #cfcdc4; }
.navbar-admin .navlinks a:hover { color: #fff; }
.navbar-admin .navlinks a { margin-left: 4px; padding: 6px 12px; border-radius: 6px; transition: background .15s; }
.navbar-admin .navlinks a:hover { background: rgba(255,255,255,0.08); }
.nav-sep { width: 1px; height: 24px; background: rgba(255,255,255,0.15); margin: 0 8px; flex-shrink: 0; }
.navbar-admin .saludo { font-size: 13px; padding: 0 8px; }
.btn-logout { border: 1px solid rgba(255,255,255,0.2); padding: 5px 12px !important; }
.btn-logout:hover { border-color: var(--coral); background: rgba(255,107,74,0.12) !important; color: var(--coral) !important; }

.acciones { white-space: nowrap; }
.accion-editar { color: var(--azul); text-decoration: none; font-size: 13px; font-weight: 500; margin-right: 12px; }
.accion-editar:hover { text-decoration: underline; }
.accion-eliminar { color: #C24A2C; text-decoration: none; font-size: 13px; font-weight: 500; }
.accion-eliminar:hover { text-decoration: underline; }

.footer { text-align: center; padding: 24px; color: var(--gris); font-size: 13px; }

/* ---------- Video playlist ---------- */
.video-lista { margin-top: 16px; background: rgba(0,0,0,0.2); border-radius: 12px; padding: 12px; }
.video-lista h3 { font-size: 14px; color: #bcd6e6; margin-bottom: 8px; font-weight: 600; }
.video-lista ul { list-style: none; padding: 0; margin: 0; }
.video-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.video-item:hover { background: rgba(255,255,255,0.08); }
.video-item.activo { background: rgba(255,255,255,0.15); }
.video-item .video-num { width: 24px; height: 24px; border-radius: 50%; background: var(--coral); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.video-item.activo .video-num { background: #fff; color: var(--coral); }
.video-item .video-tit { font-size: 13px; color: #d7e6ee; }
.video-item.activo .video-tit { color: #fff; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) { .hero-taller-inner { flex-direction: column; } .hero-taller h1 { font-size: 26px; } .hero-taller-video { align-self: stretch; } }
@media (max-width: 640px) {
  .navbar { padding: 10px 12px; flex-wrap: nowrap; gap: 0; }
  .brand img { height: 42px; }
  .nav-contacto { margin-left: 10px; gap: 10px; }
  .nav-contacto a { font-size: 12px; }
  .navlinks { gap: 10px; }
  .navlinks a { font-size: 13px; }
  .navlinks .btn-ingresar { padding: 7px 14px; }
  .hero { padding: 18px 20px 22px; }
  .hero-taller { padding: 24px 16px; }
  .hero .eyebrow { font-size: 10px; }
  .hero h1 { font-size: 18px; }
  .hero-sub { font-size: 14px; }
  .banner-slide img { height: 150px; }
  .banner-btn { width: 32px; height: 32px; font-size: 14px; }
  .grid { padding: 20px; grid-template-columns: 1fr; margin-top: 16px; gap: 16px; }
  .header-taller { padding: 20px; }
  .header-taller h1 { font-size: 24px; }
  .detalle { padding: 0 16px 40px; margin-top: 20px; }
  .auth-card { padding: 24px 20px; }
  .kpis { flex-direction: column; }
  .kpi { min-width: 0; }
  .tabla-talleres { display: block; overflow-x: auto; white-space: nowrap; }
  .dashboard { padding: 16px; }
}
@media (max-width: 460px) {
  .saludo { display: none; }
  .nav-contacto { gap: 8px; }
  .nav-contacto a { font-size: 11px; }
  .brand img { height: 36px; }
}

/* ---------- Desktop: ancho máximo centrado ---------- */
@media (min-width: 641px) {
  html { background: #808080; }
  body:not(.page-auth) { max-width: 1280px; margin: 0 auto; background: #fff; }
  body:not(.page-auth) .navbar { width: 100vw; margin-left: calc(-50vw + 50%); }
  .grid {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding-top: 32px;
    padding-bottom: 32px;
    padding-left: max(32px, calc(50vw - 640px + 32px));
    padding-right: max(32px, calc(50vw - 640px + 32px));
    background: #fff;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  }
}
