/* =========================================================
   Argentinos en Sitges — Participants Database (v2)
   Moderno, responsive y adaptable a tu paleta
   Solo ajusta las variables de color/tipografía de abajo
   ========================================================= */
:root{
  /* === PALETA DEL SITIO (AJUSTA ESTOS VALORES) === */
  --aes-primary: #0A84FF;       /* Color principal (botones, foco) */
  --aes-primary-600: #0666c7;   /* Hover/Dark del principal */
  --aes-text: #0f172a;          /* Texto principal */
  --aes-muted: #64748b;         /* Texto secundario */
  --aes-bg: #ffffff;            /* Fondo inputs/cards */
  --aes-border: #e2e8f0;        /* Borde inputs/cards */
  --aes-surface: #f8fafc;       /* Fondos suaves / secciones */

  /* === UI === */
  --aes-radius: 14px;
  --aes-shadow: 0 8px 28px rgba(2,6,23,.08);
  --aes-focus: 0 0 0 4px rgba(10,132,255,.15);

  /* Tipografía base (opcional) */
  --aes-font: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
}

/* Normaliza el plugin sin tocar el resto del theme */
.participants-database,
.pdb-form,
.pdb-signup,
.pdb-single,
.pdb-record {
  font-family: var(--aes-font);
  color: var(--aes-text);
  font-size: 16px;
  line-height: 1.55;
}

/* Contenedores: centrado y respiración */
.pdb-form,
.pdb-signup,
.pdb-single {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(.75rem, 2vw, 1.25rem);
}

/* Cabeceras dentro del contenido del plugin */
.pdb-form h1, .pdb-form h2, .pdb-form h3,
.pdb-single h1, .pdb-single h2, .pdb-single h3 {
  color: var(--aes-text);
  line-height: 1.15;
  margin: 0 0 .75rem 0;
}

/* =========================
   LAYOUT RESPONSIVE DE CAMPOS
   ========================= */
.pdb-form .pdb-field,
.pdb-record .pdb-field,
.pdb-single .pdb-field {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
  margin: 0 0 1rem 0;
}

/* En ≥768px, etiqueta a la izquierda y campo a la derecha */
@media (min-width: 768px) {
  .pdb-form .pdb-field,
  .pdb-record .pdb-field,
  .pdb-single .pdb-field {
    grid-template-columns: minmax(160px, 240px) 1fr;
    align-items: start;
  }
}

/* =========================
   ETIQUETAS, AYUDAS Y ESTADOS
   ========================= */
.pdb-label label,
.pdb-field label {
  font-weight: 650;
  color: var(--aes-text);
}

.pdb-help, .pdb-field .helptext, .pdb-description {
  font-size: .92rem;
  color: var(--aes-muted);
  margin-top: .15rem;
}

.pdb-required, .pdb-field .required {
  color: var(--aes-primary);
  font-weight: 700;
  margin-left: .2rem;
}

/* =========================
   INPUTS MODERNOS
   ========================= */
.pdb-value input[type="text"],
.pdb-value input[type="email"],
.pdb-value input[type="tel"],
.pdb-value input[type="url"],
.pdb-value input[type="number"],
.pdb-value input[type="file"],
.pdb-value select,
.pdb-value textarea {
  width: 100%;
  background: var(--aes-bg);
  border: 1px solid var(--aes-border);
  border-radius: var(--aes-radius);
  padding: .9rem 1rem;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
  box-shadow: none;
  appearance: none;
}

/* Altura y resize del textarea */
.pdb-value textarea {
  min-height: 160px;
  resize: vertical;
}

/* Focus accesible */
.pdb-value input:focus,
.pdb-value select:focus,
.pdb-value textarea:focus {
  border-color: var(--aes-primary);
  box-shadow: var(--aes-focus);
}

/* Placeholder legible */
.pdb-value ::placeholder { color: #94a3b8; }

/* Select con flecha nativa “limpia” (sin colores raros) */
.pdb-value select {
  background-image: none;
}

/* File input más limpio y clickable */
.pdb-value input[type="file"] {
  padding: .6rem;
  cursor: pointer;
}

/* Radios y checkboxes */
.pdb-checkboxes label,
.pdb-radios label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 500;
}
.pdb-checkboxes input[type="checkbox"],
.pdb-radios input[type="radio"] { transform: translateY(1px); }

/* =========================
   CARDS PARA SINGLE / GRUPOS
   ========================= */
.pdb-single .pdb-field {
  background: var(--aes-bg);
  border: 1px solid var(--aes-border);
  border-radius: var(--aes-radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--aes-shadow);
}

/* Bloques/separadores */
.pdb-fieldset,
.pdb-legend,
.pdb-group-title {
  margin: 1.25rem 0 .75rem 0;
  font-weight: 750;
  color: var(--aes-text);
}

/* =========================
   MENSAJES DE ERROR / ÉXITO
   ========================= */
.pdb-error,
.pdb-error .message,
.pdb-errmsg {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: .85rem 1rem;
  border-radius: var(--aes-radius);
  margin: .75rem 0;
}

.pdb-success,
.pdb-form .success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: .9rem 1rem;
  border-radius: var(--aes-radius);
  margin: 1rem 0;
}

/* =========================
   BOTONES (submit/enlaces)
   ========================= */
.pdb-submit,
.pdb-form input[type="submit"],
.pdb-record input[type="submit"],
.pdb-single input[type="submit"],
.pdb-form .button,
.pdb-form a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--aes-primary);
  color: #fff !important;
  border: 0;
  border-radius: calc(var(--aes-radius) - 2px);
  padding: .9rem 1.2rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .07s ease, background .18s ease, box-shadow .18s ease;
  box-shadow: var(--aes-shadow);
  text-decoration: none;
  line-height: 1;
}
.pdb-submit:hover,
.pdb-form input[type="submit"]:hover,
.pdb-form .button:hover,
.pdb-form a.button:hover {
  background: var(--aes-primary-600);
  transform: translateY(-1px);
}
.pdb-submit:active,
.pdb-form input[type="submit"]:active { transform: translateY(0); }

/* Enlaces dentro del formulario */
.pdb-form a { color: var(--aes-primary); text-decoration: none; }
.pdb-form a:hover { text-decoration: underline; }

/* =========================
   TABLAS LEGADO → RESET
   ========================= */
.pdb-form table, .pdb-single table {
  width: 100%;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
}
.pdb-form td, .pdb-form th,
.pdb-single td, .pdb-single th { border: 0; padding: 0; }

/* =========================
   BLOQUES COMPUESTOS (URL + Texto del link, etc.)
   ========================= */
.pdb-value .link-inputs,
.pdb-value .composite-field {
  display: grid;
  gap: .6rem;
}
@media (min-width: 640px) {
  .pdb-value .link-inputs,
  .pdb-value .composite-field {
    grid-template-columns: 1fr 1fr;
  }
}

/* =========================
   RESPONSIVIDAD GLOBAL
   ========================= */
@media (max-width: 767px) {
  .pdb-form, .pdb-single { padding: .75rem; }
  .pdb-form .pdb-field,
  .pdb-single .pdb-field { grid-template-columns: 1fr; }
}

/* (Opcional) Sección suave detrás del formulario */
.pdb-form-wrap, .pdb-single-wrap {
  background: var(--aes-surface);
  border-radius: calc(var(--aes-radius) + 4px);
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

/* (Opcional) Suavizar imágenes subidas en SINGLE */
.pdb-single .pdb-value img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--aes-border);
}
