/* Listado público de formularios */

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: linear-gradient(160deg, #f8fafc 0%, #eff6ff 100%);
}

.app-loader.hidden {
  display: none;
}

.app-loader-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid #bfdbfe;
  border-top-color: #1d4ed8;
  border-radius: 50%;
  animation: app-spin 0.8s linear infinite;
}

.app-loader p {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
}

@keyframes app-spin {
  to { transform: rotate(360deg); }
}

.app-root[hidden] {
  display: none !important;
}

.forms-list {
  display: grid;
  gap: 1rem;
}

.form-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.form-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 12px 28px -12px rgba(30, 64, 175, 0.28);
  transform: translateY(-2px);
}

.form-card__media {
  display: block;
  line-height: 0;
  background: #f1f5f9;
}

.form-card__media img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.form-card__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.form-card--venue .form-card__img--aside {
  display: none;
}

@media (min-width: 768px) {
  .form-card--venue {
    flex-direction: row;
    align-items: stretch;
  }

  .form-card--venue .form-card__media {
    flex: 0 0 17.5rem;
    width: 17.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #f8fafc;
  }

  .form-card--venue .form-card__img--stack {
    display: none !important;
  }

  .form-card--venue .form-card__img--aside {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 28rem;
    object-fit: contain;
  }

  .form-card--venue .form-card__content {
    flex: 1 1 auto;
  }

  .form-card--venue .form-card__body {
    flex: 1 1 auto;
  }
}

.form-card__body {
  padding: 1.25rem 1.35rem 1rem;
}

.form-card__badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin-bottom: 0.65rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-card__title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  line-height: 1.35;
  font-weight: 700;
  color: #0f172a;
}

.form-card__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.form-card__facts li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 0;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.4;
}

.form-card__facts li i {
  flex-shrink: 0;
  margin-top: 0.15rem;
  width: 1rem;
  text-align: center;
  color: #2563eb;
  font-size: 0.85rem;
}

.form-card__facts li span {
  min-width: 0;
  word-break: break-word;
}

.form-card__facts-wide {
  grid-column: 1 / -1;
}

.form-card__footer {
  display: flex;
  gap: 0.65rem;
  padding: 0.85rem 1.35rem 1.1rem;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}

.form-card__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.form-card__btn--primary {
  background: #1e40af;
  color: #fff;
  border: 1px solid #1e40af;
}

.form-card__btn--primary:hover {
  background: #1e3a8a;
  border-color: #1e3a8a;
}

.form-card__btn--ghost {
  background: #fff;
  color: #1e40af;
  border: 1px solid #cbd5e1;
}

.form-card__btn--ghost:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

#qrModalBackdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

#qrModalBackdrop.hidden {
  display: none;
}

#qrModalBackdrop .qr-modal-box {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 90vw;
  width: 22rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

#qrModalContent {
  min-height: 256px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#qrModalContent canvas,
#qrModalContent img {
  border-radius: 8px;
}

.qr-modal-link-label {
  margin: 1rem 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

#qrModalUrl {
  margin: 0;
  font-size: 0.8rem;
  color: #475569;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 520px) {
  .form-card__facts {
    grid-template-columns: 1fr;
  }

  .form-card__footer {
    flex-direction: column;
  }
}
