/* Public CSS */
.wper-calendario,
.wper-inscripcion-wrap,
.wper-ficha {
  font-family: inherit;
}

.wper-cal-title {
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
}

.wper-cal-empty {
  color: #888;
  font-style: italic;
}

/* Grid de cards */
.wper-cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
}

/* Card */
.wper-cal-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
}

.wper-cal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
}

.wper-cal-card.wper-cal-cerrado {
  background: #fafafa;
}

.wper-cal-card.wper-cal-cerrado .wper-cal-poster {
  filter: grayscale(100%);
  opacity: .7;
}

/* Poster */
.wper-cal-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #f0f0f0;
  overflow: hidden;
}

.wper-cal-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wper-cal-poster-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, .9);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  opacity: 0;
  transition: opacity .2s;
}

.wper-cal-poster:hover .wper-cal-poster-zoom {
  opacity: 1;
}

.wper-cal-content {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Card head */
.wper-cal-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}

.wper-cal-estado {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: .25rem .75rem;
  border-radius: 4px;
}

.wper-estado-abierto {
  background: #e6f6ec;
  color: #0c6b37;
}

.wper-estado-cerrado {
  background: #fdf2f2;
  color: #9b1c1c;
}

.wper-cal-modalidad {
  font-size: .75rem;
  font-weight: 600;
  color: #6b7280;
}

/* Nombre */
.wper-cal-nombre {
  font-size: 1.25rem;
  line-height: 1.3;
  color: #111827;
  font-weight: 800;
  margin: 0 0 .5rem;
}

/* Extra meta */
.wper-cal-extra-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.wper-ritmo-badge {
  background: #f1f5f9;
  color: #475569;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid #e2e8f0;
}

.wper-tiempo-text {
  font-size: .85rem;
  color: #64748b;
  font-weight: 600;
}

.wper-fide-badge {
  background: #eef2ff;
  color: #4f46e5;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 800;
  border: 1px solid #c7d2fe;
  line-height: 1;
}

.wper-subvencionable-badge {
  background: #fffbea;
  color: #a26b00;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 800;
  border: 1px solid #fde68a;
  line-height: 1;
}

/* Tabs */
.wper-cal-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 2rem;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 10px;
}

.wper-tab-btn {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.wper-tab-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.wper-tab-btn.active {
  background: #2271b1;
  color: #fff;
}

.wper-tab-content {
  display: none;
}

.wper-tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Meta */
.wper-cal-meta {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.wper-cal-meta-item {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .9rem;
  color: #4b5563;
  line-height: 1.4;
}

.wper-meta-icon {
  flex-shrink: 0;
  width: 1.2rem;
  text-align: center;
}

.wper-btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4f46e5;
  border-radius: 6px;
  padding: 4px 8px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  transition: all .2s ease;
  margin-left: 6px;
  vertical-align: middle;
}

.wper-btn-mini:hover {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
  transform: translateY(-1px);
}

.wper-cal-obs {
  margin-top: .5rem;
  padding-top: .75rem;
  border-top: 1px dotted #e5e7eb;
}

.wper-obs-preview {
  font-size: .85rem;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.wper-btn-obs-more {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  color: #2271b1;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 4px;
}

/* Modal Simple */
.wper-modal {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wper-modal-content {
  background-color: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 650px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  position: relative;
  animation: wperModalIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

@keyframes wperModalIn {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.wper-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wper-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #111827;
}

.wper-modal-close {
  font-size: 28px;
  font-weight: bold;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  transition: color .2s;
}

.wper-modal-close:hover {
  color: #111827;
}

.wper-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
  line-height: 1.6;
  color: #374151;
}

.wper-modal-body p { margin-bottom: 1.2rem; }
.wper-modal-body p:last-child { margin-bottom: 0; }

/* Botones */
.wper-cal-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}


.wper-btn {
  display: inline-block;
  padding: .5rem 1rem;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all .15s;
}

.wper-btn-primary {
  background: #2271b1;
  color: #fff;
}

.wper-btn-primary:hover {
  background: #135e96;
  color: #fff;
}

.wper-btn-outline {
  background: transparent;
  border: 1px solid #2271b1;
  color: #2271b1;
}

.wper-btn-outline:hover {
  background: #f0f6ff;
}

.wper-btn-disabled {
  background: #e0e0e0;
  color: #999;
  cursor: default;
}

.wper-btn-listado {
  background: #6b7280;
  color: #fff;
}

.wper-btn-listado:hover {
  background: #4b5563;
  color: #fff;
}

/* Tabla de listado */
.wper-table-listado {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.9rem;
}

.wper-table-listado th,
.wper-table-listado td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.wper-table-listado th {
  background-color: #f9fafb;
  font-weight: 700;
  color: #374151;
}

.wper-table-listado tr:hover {
  background-color: #f3f4f6;
}

/* Inline form toggle */
.wper-cal-form-inline {
  margin-top: 1rem;
  border-top: 1px solid #eee;
  padding-top: 1rem;
}

/* ── Formulario de inscripción ── */
.wper-inscripcion-wrap {
  max-width: 680px;
}

.wper-form-evento-info {
  background: #f7f9fc;
  border-left: 3px solid #2271b1;
  padding: .6rem 1rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1rem;
  font-size: .9rem;
}

.wper-aviso {
  padding: .8rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: .9rem;
}

.wper-aviso-cerrado {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

.wper-aviso-ok {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.wper-aviso-error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.wper-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: .8rem;
}

/* @media(max-width:560px){ .wper-form-row { grid-template-columns: 1fr; } } */
.wper-form-group {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.wper-form-group label {
  font-size: .85rem;
  font-weight: 600;
  color: #333;
}

.wper-form-group input[type="text"],
.wper-form-group input[type="email"],
.wper-form-group input[type="tel"] {
  padding: .5rem .75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: .95rem;
  transition: border-color .15s;
}

.wper-form-group input:focus {
  border-color: #2271b1;
  outline: none;
  box-shadow: 0 0 0 2px rgba(34, 113, 177, .15);
}

.wper-form-group-check {
  justify-content: flex-end;
}

.wper-check-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  cursor: pointer;
}

.wper-form-submit {
  margin-top: .5rem;
}

.wper-required {
  color: #d63638;
}

.wper-form-msg {
  padding: .75rem 1rem;
  border-radius: 6px;
  margin-bottom: .8rem;
  font-size: .9rem;
}

/* ── Ficha ── */
.wper-ficha {
  max-width: 720px;
}

.wper-ficha-titulo {
  font-size: 1.6rem;
  margin-bottom: .5rem;
}

.wper-ficha-badges {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
}

.wper-ficha-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
  margin-bottom: 1.2rem;
}

@media(max-width:480px) {
  .wper-ficha-grid {
    grid-template-columns: 1fr;
  }
}

.wper-ficha-item {
  background: #f7f9fc;
  border-radius: 6px;
  padding: .6rem .9rem;
}

.wper-ficha-item-full {
  grid-column: 1 / -1;
}

.wper-ficha-label {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #888;
  margin-bottom: .15rem;
}

.wper-ficha-value {
  font-size: .95rem;
  color: #222;
}

.wper-ficha-value a {
  color: #2271b1;
}

.wper-ficha-map {
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
}

.wper-ficha-inscripcion h3 {
  margin-bottom: .8rem;
}