body {
  margin: 0;
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
  background-color: #f0f4f8;
  color: #333;
}

.instruction {
  text-align: center;
  padding: 20px 20px 10px 20px;
  background-color: #fff;
  margin: 20px auto;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(60, 80, 120, 0.08);
  max-width: 800px;
  border: 1px solid #e3e8ee;
}

.instruction p {
  font-size: 1.1em;
  color: #2a4d69;
  margin: 0;
  font-weight: 500;
  line-height: 1.6;
}

.card,
.filters select,
.filters input,
.filters button {
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
}

.cards-container {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
  padding: 40px 10px;
}

.card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(60, 80, 120, 0.1),
    0 1.5px 4px rgba(60, 80, 120, 0.06);
  padding: 32px 28px;
  max-width: 340px;
  min-width: 260px;
  transition: box-shadow 0.2s;
  border: 1px solid #e3e8ee;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.card a {
  color: #2563eb;
  word-break: break-all; /* Rompe enlaces largos */
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s;
}

.card a:hover {
  color: #4f81c7;
}

.card:hover {
  box-shadow: 0 8px 32px rgba(60, 80, 120, 0.16),
    0 2px 8px rgba(60, 80, 120, 0.1);
}

.card-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #3d4a5c;
  margin-bottom: 10px;
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: #2a4d69;
  letter-spacing: 0.01em;
}
.card p {
  margin: 6px 0;
  color: #444;
  font-size: 1em;
}

.card strong {
  color: #4f81c7;
}

.filters {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 0 auto;
  padding-bottom: 16px;
  width: 80%;
  margin-top: 50px;
  box-sizing: border-box;
}

.filters select,
.filters input {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #b3c6ff;
  font-size: 1em;
}

.filters button {
  padding: 8px 18px;
  border-radius: 6px;
  border: none;
  background: #4f81c7;
  color: #fff;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}

.filters button:hover {
  background: #2a4d69;
}

.filters select {
  padding: 8px 36px 8px 12px;
  border-radius: 8px;
  border: 1.5px solid #b3c6ff;
  background: linear-gradient(90deg, #eaf1fb 60%, #dbeafe 100%);
  font-size: 1em;
  color: #2a4d69;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,<svg width='16' height='16' fill='gray' xmlns='http://www.w3.org/2000/svg'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
  box-shadow: 0 2px 8px rgba(60, 60, 60, 0.06);
  transition: border 0.2s, box-shadow 0.2s;
}

.filters input {
  padding: 8px 36px 8px 12px;
  border-radius: 8px;
  border: 1.5px solid #b3c6ff;
  font-size: 1em;
  color: #2a4d69;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
  box-shadow: 0 2px 8px rgba(60, 60, 60, 0.06);
  transition: border 0.2s, box-shadow 0.2s;
  width: 80%;
  box-sizing: border-box;
}

.filters select:focus {
  outline: none;
  border: 1.5px solid #4f81c7;
  box-shadow: 0 0 0 2px #b3c6ff55;
}

.card:focus-within,
.card-button:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .cards-container {
    padding: 20px 5px;
    flex-direction: column;
    align-items: center;
  }
  .card {
    max-width: 400px; /* O el ancho que prefieras */
    min-width: 300px; /* Opcional, para mantener consistencia */
    width: 100%;
    box-sizing: border-box;
    padding: 24px;
    margin: 0 auto;
  }
  .card button,
  .card .card-button,
  .filters button {
    width: 80%;
    box-sizing: border-box;
    display: block;
    margin-top: 12px;
  }
  .filters {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  #city-filter,
  #type-filter,
  #modality-filter {
    width: 80%;
  }
}

/* .alateen-card h3,
.alateen-card strong {
  color: rgba(205, 39, 45) !important;
} */

/* Cinta/moño para tarjetas */
.ribbon {
  position: absolute;
  top: 18px;
  right: -35px;
  transform: rotate(45deg);
  width: 120px;
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.95em;
  padding: 6px 0;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(60, 60, 60, 0.08);
  letter-spacing: 0.03em;
  pointer-events: none;
  border-radius: 4px;
  overflow: visible;
  text-transform: uppercase;
  white-space: nowrap;
}

.ribbon-alanon {
  background: #2563eb;
  opacity: 0.85;
}

.ribbon-alateen {
  background: #cd272d;
  opacity: 0.7;
}

.ribbon-comite {
  background: #222;
  opacity: 0.85;
}

/* Para que la tarjeta permita la cinta en posición absoluta */
.card {
  position: relative;
  overflow: visible;
}
