:root {
    --ink: #161616;
    --muted: #5c5c5c;
    --line: #e6e6e6;
    --paper: #ffffff;
    --yellow: #ffcc00;
    --card: #ffffff;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    --font: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
}

button, input, select, textarea { font-family: inherit; }

a { color: inherit; }

.yellow-bar {
    height: 18px;
    background: var(--yellow);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.85rem 4vw;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.brand {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.site-nav {
    display: flex;
    gap: 1.25rem;
    font-weight: 600;
    font-size: 0.98rem;
}

.site-nav a { text-decoration: none; }

.site-nav a:hover { text-decoration: underline; }

.nav-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.stats {
    display: flex;
    gap: 0.85rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.stats strong {
    color: var(--ink);
    font-weight: 800;
}

.hero {
    max-width: 920px;
    margin: 0 auto;
    padding: 4.2rem 1.25rem 1.2rem;
    text-align: center;
    scroll-margin-top: 5.5rem;
}

.hero h1 {
    margin: 0;
    font-size: clamp(3.2rem, 7vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 0.95;
}

.hero-lead,
.section-lead,
.dia-linea {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.5;
}

.hero-lead {
    max-width: 46rem;
    margin: 1.3rem auto 0.8rem;
}

.dia-linea {
    margin: 0;
    font-weight: 600;
}

.dia-linea span + span::before { content: " · "; }

.listado {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.5rem 1.25rem 3rem;
}

.filtros-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 1rem;
    margin: 0.4rem 0 1.6rem;
}

.filtros {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1rem;
}

.filtro,
#btn-todas {
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #8a8a8a;
    font-weight: 600;
    padding: 0.35rem 0.05rem;
}

.filtro {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.filtro.activa,
#btn-todas:hover,
.filtro:hover {
    color: var(--ink);
}

.filtro.activa { border-bottom-color: var(--ink); }

.punto {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.punto-ocupado { background: var(--ink); }
.punto-libre { background: #c8c8c8; }

.lista-eventos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem 1.25rem;
}

.evento-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: var(--card);
    border: 1px solid #ededed;
    border-radius: 2px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.evento-card.pasado { opacity: 0.72; }

.evento-cover {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.15rem;
    min-height: 168px;
    padding: 1rem 1.05rem;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.28)),
        var(--cat, #222);
    color: #fff;
}

.evento-cover-hora {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

.evento-cover-cat {
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.92;
}

.evento-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem 1.05rem 0.9rem;
}

.evento-card h3 {
    margin: 0 0 0.55rem;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.evento-desc {
    margin: 0;
    color: #4a4a4a;
    font-size: 0.98rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.evento-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1.3rem;
}

.chip-pri {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #777;
}

.evento-footer span:last-child {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}

.ver-mas,
.link-eliminar {
    border: 0;
    background: transparent;
    padding: 0;
    font-weight: 600;
}

.ver-mas { color: #3a3a3a; }
.ver-mas::after { content: " ›"; }
.link-eliminar { color: #9a3412; font-size: 0.85rem; }

.ver-mas:hover,
.link-eliminar:hover { text-decoration: underline; }

.vacio {
    grid-column: 1 / -1;
    margin: 1rem 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 1.05rem;
}

.calendar-section {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.5rem 1.25rem 4rem;
    scroll-margin-top: 5.5rem;
}

.calendar-section h2 {
    margin: 0;
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.section-lead,
.leyenda {
    text-align: center;
}

.section-lead { margin: 0.6rem auto 0.4rem; }

.leyenda {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.leyenda span { display: inline-flex; align-items: center; gap: 0.4rem; }

.calendar-card {
    padding: 0.7rem 0.8rem 0.3rem;
    border: 1px solid var(--line);
    background: #fff;
}

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 0;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-weight: 700;
    padding: 0.55rem 0.95rem;
    text-decoration: none;
}

.btn-accent:hover,
.btn-accent:focus { background: #000; color: #fff; }

.btn-link-quiet {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
}

.form-control,
.form-select {
    border-color: #d9d9d9;
    border-radius: 2px;
}

.form-control:focus,
.form-select:focus {
    border-color: #111;
    box-shadow: 0 0 0 0.2rem rgba(255, 204, 0, 0.45);
}

.form-hint,
.field-error { font-size: 0.82rem; }
.form-hint { margin: 0; color: var(--muted); }
.field-error { min-height: 1rem; color: #9f1239; }
.is-invalid { border-color: #be123c; }

.modal-content { border-radius: 2px; border: 0; }
.modal-title { font-weight: 800; letter-spacing: -0.03em; }
.modal-header,
.modal-footer { border-color: var(--line); }
#alerta-solape ul { padding-left: 1.1rem; }

.pagina-error {
    display: grid;
    place-items: center;
    padding: 2rem;
}

.pagina-error main { max-width: 28rem; }
.pagina-error h1 { font-weight: 800; margin: 0.3rem 0 1rem; }

.fc {
    --fc-border-color: #ececec;
    --fc-page-bg-color: #fff;
    --fc-neutral-bg-color: #fafafa;
    --fc-today-bg-color: rgba(255, 204, 0, 0.28);
    --fc-button-bg-color: #161616;
    --fc-button-border-color: #161616;
    --fc-button-text-color: #fff;
    --fc-button-hover-bg-color: #000;
    --fc-button-hover-border-color: #000;
    --fc-button-active-bg-color: var(--yellow);
    --fc-button-active-border-color: var(--yellow);
    --fc-button-active-text-color: #161616;
    --fc-event-border-color: transparent;
    font-family: var(--font);
}

.fc .fc-toolbar-title {
    font-size: 1.25rem !important;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.fc .fc-button {
    border-radius: 999px !important;
    font-weight: 700;
    text-transform: capitalize;
    box-shadow: none !important;
}

.fc .fc-button-group > .fc-button { border-radius: 0 !important; }
.fc .fc-button-group > .fc-button:first-child { border-radius: 999px 0 0 999px !important; }
.fc .fc-button-group > .fc-button:last-child { border-radius: 0 999px 999px 0 !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: #161616; }

.fc-event {
    border: 0;
    border-radius: 4px;
    font-weight: 700;
}

.fc .fc-daygrid-day.dia-ocupado .fc-daygrid-day-number::after,
.fc .fc-col-header-cell.dia-ocupado .fc-col-header-cell-cushion::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 6px;
    border-radius: 50%;
    background: #161616;
}

.fc .fc-daygrid-day.dia-libre .fc-daygrid-day-number::after,
.fc .fc-col-header-cell.dia-libre .fc-col-header-cell-cushion::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 6px;
    border-radius: 50%;
    background: #d0d0d0;
}

.fc .fc-daygrid-day.dia-seleccionado,
.fc .fc-timegrid-col.dia-seleccionado {
    box-shadow: inset 0 0 0 2px #161616;
}

.fc .fc-timegrid-col.dia-ocupado { background: rgba(255, 204, 0, 0.08); }

@media (max-width: 991.98px) {
    .lista-eventos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-nav { display: none; }
}

.link-salir {
    border: 0;
    background: transparent;
    color: #444;
    font-weight: 600;
    padding: 0;
}

.link-salir:hover { text-decoration: underline; }

.pantalla-acceso {
    max-width: 36rem;
    margin: 0 auto;
    padding: 4rem 1.25rem 3rem;
    text-align: center;
}

.pantalla-acceso h1 {
    margin: 0;
    font-size: clamp(3rem, 7vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.045em;
}

.caja-acceso {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 1.6rem;
    text-align: left;
}

.caja-acceso label {
    font-weight: 700;
    font-size: 0.92rem;
}

.caja-acceso input {
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    padding: 0.7rem 0.75rem;
    font: inherit;
}

.caja-acceso input:focus {
    outline: 2px solid rgba(255, 204, 0, 0.8);
    border-color: #111;
}

.caja-acceso .btn-accent { justify-content: center; }

.acceso-error,
.acceso-ok {
    margin: 0;
    padding: 0.7rem 0.8rem;
    font-size: 0.92rem;
}

.acceso-error { background: #fff1f2; color: #9f1239; }
.acceso-ok { background: #f7f7f7; color: #222; }

.acceso-alternativa {
    margin-top: 1.4rem;
    font-size: 0.92rem;
}

.acceso-alternativa a { color: #444; }

.rol-usuario {
    font-size: 0.85rem;
    color: #666;
}

@media (max-width: 719.98px) {
    .site-header { flex-wrap: wrap; gap: 0.7rem; }
    .nav-meta { width: 100%; justify-content: space-between; }
    .stats { gap: 0.55rem; }
    .lista-eventos { grid-template-columns: 1fr; }
    .hero { padding-top: 2.6rem; }
    .btn-accent span { display: none; }
}
