/* =========================================================
   FEBOBI · Estructura
   Barra de lectura, encabezado, secciones, pie, menú móvil,
   barra de progreso, botón subir y aviso flotante.
   ========================================================= */

/* ---------- Progreso de lectura ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 120; pointer-events: none; }
.progress span { display: block; height: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--gold), var(--gold-2)); }

/* ---------- Barra de lectura cómoda ---------- */
.utility { background: var(--felt-950); color: var(--on-felt-2); font-size: .82rem; }
.utility__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; }
.utility__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.utility__label { display: inline-flex; align-items: center; gap: 6px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid rgba(255,255,255,.22); border-radius: var(--pill); }
.seg button { min-width: 40px; height: 36px; border: 0; border-radius: var(--pill); background: transparent; color: var(--on-felt); font-weight: 700; font-size: .85rem; line-height: 1; }
.seg .seg--md { font-size: 1.05rem; }
.seg .seg--lg { font-size: 1.3rem; }
.seg button[aria-pressed="true"], .utility__btn[aria-pressed="true"] { background: var(--gold-2); color: var(--on-gold); border-color: transparent; }
.utility__btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--pill); border: 1px solid rgba(255,255,255,.22); background: transparent; color: var(--on-felt); text-decoration: none; font-weight: 700; }
.utility__btn:hover { background: rgba(255,255,255,.08); }
@media (max-width: 900px) { .utility__tag { display: none; } .utility__in { justify-content: center; } }
@media (max-width: 520px) { .utility__label span, .utility__login { display: none; } }

/* ---------- Encabezado ---------- */
.header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h); border-bottom: 1px solid transparent;
  background: rgba(246,241,230,.88); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  transition: box-shadow .3s, border-color .3s, background-color .3s;
}
.header.is-scrolled { border-color: var(--line); background: rgba(255,253,248,.94); box-shadow: 0 6px 24px -12px rgba(10,30,20,.25); }
:root[data-contrast="high"] .header { background: #fff; border-bottom: 2px solid #000; }
.header__in { height: 100%; display: flex; align-items: center; gap: 16px; }
.header__in > * { min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; flex: none; text-decoration: none; }
.brand__logo { width: 52px; height: 52px; object-fit: contain; }
.brand__txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand__txt strong { font-family: var(--display); font-weight: 600; font-size: 1.35rem; letter-spacing: .02em; color: var(--felt-800); }
.brand__txt small { font-size: .74rem; color: var(--ink-2); }
.nav { display: flex; gap: 2px; margin-inline: auto; }
.nav a { padding: 10px 12px; white-space: nowrap; border-radius: var(--pill); text-decoration: none; font-weight: 700; font-size: .95rem; color: var(--ink-2); transition: color .2s, background-color .2s; }
.nav a:hover { color: var(--ink); background: rgba(15,80,57,.07); }
.nav a.is-active { color: var(--felt-700); background: rgba(15,80,57,.1); }
:root[data-contrast="high"] .nav a.is-active { background: #000; color: #fff; }
.header__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.search-trigger { display: inline-flex; align-items: center; gap: 10px; min-width: 150px; white-space: nowrap; min-height: 48px; padding: 0 14px 0 16px; border-radius: var(--pill); border: 2px solid var(--line-2); background: var(--card); color: var(--ink-2); font-weight: 700; transition: border-color .2s, box-shadow .2s; }
.search-trigger:hover { border-color: var(--felt-700); box-shadow: var(--shadow-sm); }
.search-trigger kbd { margin-left: auto; }
.menu-btn { display: none; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: var(--pill); border: 0; background: var(--felt-700); color: #fff; font-weight: 700; }
/* Cortes medidos: menú completo (≈1100px) desde 1280; botón "Mis inscripciones" desde 1024 */
@media (min-width: 1280px) and (max-width: 1439px) { .brand__txt small, .search-trigger kbd { display: none; } }
@media (max-width: 1279px) { .nav { display: none; } .menu-btn { display: inline-flex; } .header__actions { margin-left: auto; } }
@media (max-width: 1023px) { .header__cta { display: none; } }
@media (max-width: 720px) {
  :root { --header-h: 72px; }
  .search-trigger kbd, .brand__txt small { display: none; }
  .search-trigger { min-width: 0; padding: 0 14px; }
  .brand__logo { width: 44px; height: 44px; }
}
@media (max-width: 560px) {
  .header__in { gap: 12px; }
  html[data-size="2"] .brand__txt, html[data-size="3"] .brand__txt { display: none; }
}
@media (max-width: 420px) { .search-trigger { width: 48px; padding: 0; justify-content: center; } .search-trigger span { display: none; } }
@media (max-width: 360px) { .menu-btn { width: 48px; padding: 0; justify-content: center; } .menu-btn span { display: none; } }

/* ---------- Secciones ---------- */
.section { position: relative; padding: clamp(72px, 9vw, 120px) 0; }
.section--paper { background: var(--paper); border-block: 1px solid var(--line); }
.section--felt { color: var(--on-felt); background: radial-gradient(900px 500px at 90% 0%, rgba(61,154,115,.25), transparent 60%), linear-gradient(180deg, var(--felt-800), var(--felt-900)); }
.section__head { max-width: 760px; margin-bottom: clamp(32px, 4vw, 52px); }
.section__head--row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.section__head--row > div:first-child { max-width: 720px; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head--center .eyebrow { justify-content: center; }
.section__title { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 3.8vw, 3.1rem); letter-spacing: -.015em; }
.section__lead { margin-top: 14px; font-size: 1.1rem; color: var(--ink-2); }
.section--felt .section__lead { color: var(--on-felt-2); }

/* ---------- Pie ---------- */
.footer { background: var(--felt-950); color: var(--on-felt-2); padding: 72px 0 0; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer__brand img { width: 72px; height: 72px; object-fit: contain; margin-bottom: 14px; }
.footer__brand strong { font-family: var(--display); font-weight: 600; font-size: 1.4rem; color: #fff; }
.footer__muted { margin-top: 10px; font-size: .92rem; opacity: .8; }
.footer h4 { margin-bottom: 14px; color: var(--gold-2); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; }
.footer nav, .footer__col { display: grid; align-content: start; gap: 4px; }
.footer nav a, .footer__btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--on-felt); text-decoration: none; text-align: left; }
.footer nav a:hover, .footer__btn:hover { color: var(--gold-2); }
.footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 56px; padding: 24px 0 96px; border-top: 1px solid rgba(255,255,255,.1); font-size: .9rem; }
.footer__bottom a { color: var(--on-felt); }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- Diálogos (base común) ---------- */
dialog { padding: 0; border: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(4,20,14,.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog[open] { animation: dlg-in .3s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* Menú móvil */
.drawer { margin: 0 0 0 auto; width: min(400px, 100%); height: 100%; }
.drawer[open] { animation: drawer-in .3s var(--ease); }
@keyframes drawer-in { from { opacity: 0; transform: translateX(40px); } }
.drawer__box { display: grid; align-content: start; gap: 16px; height: 100dvh; padding: 20px; overflow-y: auto; background: var(--paper); }
.drawer__top { display: flex; align-items: center; justify-content: space-between; }
.drawer__top strong { font-family: var(--display); font-weight: 600; font-size: 1.5rem; }
.drawer__search { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 18px; border-radius: 16px; border: 2px solid var(--line-2); background: var(--card); color: var(--ink-2); font-weight: 700; text-align: left; }
.drawer__nav { display: grid; gap: 4px; }
.drawer__nav a { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 0 16px; border-radius: 14px; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.drawer__nav a:hover { background: var(--ivory); }
.drawer__nav .ic { color: var(--felt-600); }

/* ---------- Aviso y botón subir ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 300; max-width: min(560px, 100% - 32px); padding: 16px 22px; border-radius: 16px;
  background: var(--felt-950); color: #fff; box-shadow: var(--shadow-lg); font-weight: 700; text-align: center;
  transform: translate(-50%, 140%); opacity: 0; transition: transform .4s var(--ease), opacity .4s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90; display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 20px;
  border-radius: var(--pill); border: 0; background: var(--felt-700); color: #fff; font-weight: 700; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(20px); pointer-events: none; transition: opacity .3s, transform .3s var(--ease), background-color .2s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--felt-600); }
/* En celular: botón redondo que no tapa el contenido */
@media (max-width: 720px) { .to-top { right: 14px; bottom: 14px; width: 52px; min-height: 52px; padding: 0; justify-content: center; } .to-top span { display: none; } }
