/* ============================================
   WPMI — World Peace Meditation Initiative
   Custom Stylesheet v1.0
   Subir via: WordPress Admin → Meditators → CSS Manager
   Ruta en servidor: /wp-content/uploads/wpmi/wpmi-styles.css
   ============================================ */


/* ============================================
   TABLA DE CONTENIDOS
   1. Reset y base compartida
   2. Layout del formulario
   3. Campos de input y select
   4. Autocomplete de ciudad
   5. Checkboxes personalizados
   6. Mensajes de error y éxito
   7. Botón de envío
   8. Mapa interactivo y contador
   9. Tema INGLÉS  (.wpmi-en) — azul  #1B4F8A
  10. Tema ESPAÑOL (.wpmi-es) — dorado #C9A800
  11. Tema FRANCÉS (.wpmi-fr) — rojo  #B22222
  12. Responsive / mobile
   ============================================ */


/* ============================================
   1. RESET Y BASE COMPARTIDA
   ============================================ */

.wpmi-en *,
.wpmi-en *::before,
.wpmi-en *::after,
.wpmi-es *,
.wpmi-es *::before,
.wpmi-es *::after,
.wpmi-fr *,
.wpmi-fr *::before,
.wpmi-fr *::after {
  box-sizing: border-box;
}


/* ============================================
   2. LAYOUT DEL FORMULARIO
   ============================================ */

.wpmi-form-wrapper {
  max-width: 560px;
  margin: 0 auto;
  font-family: inherit;
}

.wpmi-field {
  margin-bottom: 18px;
}

.wpmi-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #2c2c2c;
  margin-bottom: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wpmi-req {
  color: #B22222;
  margin-left: 2px;
}

.wpmi-field--age {
  max-width: 160px;
}

.wpmi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.wpmi-hint {
  font-size: 12px;
  color: #999;
  margin: 5px 0 0;
}


/* ============================================
   3. CAMPOS DE INPUT Y SELECT
   Estilos base neutrales — los colores de foco
   se sobreescriben en cada sección de tema.
   ============================================ */

.wpmi-en input[type="text"],
.wpmi-en input[type="email"],
.wpmi-en input[type="number"],
.wpmi-en select,
.wpmi-es input[type="text"],
.wpmi-es input[type="email"],
.wpmi-es input[type="number"],
.wpmi-es select,
.wpmi-fr input[type="text"],
.wpmi-fr input[type="email"],
.wpmi-fr input[type="number"],
.wpmi-fr select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #d0d0d0;
  border-radius: 6px;
  font-size: 15px;
  color: #1a1a1a;
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

/* Select — flecha base (se sobreescribe por tema) */
.wpmi-en select,
.wpmi-es select,
.wpmi-fr select {
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Estado de error en cualquier input */
.wpmi-en .wpmi-input-error,
.wpmi-es .wpmi-input-error,
.wpmi-fr .wpmi-input-error {
  border-color: #B22222 !important;
  box-shadow: 0 0 0 3px rgba(178, 34, 34, 0.10) !important;
}


/* ============================================
   4. AUTOCOMPLETE DE CIUDAD
   ============================================ */

.wpmi-ac-wrap {
  position: relative;
}

.wpmi-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  max-height: 220px;
  overflow-y: auto;
  display: none;
  /* El border-color se define en cada tema */
  border: 1.5px solid #d0d0d0;
}

.wpmi-suggestions.wpmi-open {
  display: block;
}

.wpmi-suggestion-item {
  padding: 10px 14px;
  font-size: 14px;
  color: #1a1a1a;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  line-height: 1.4;
  transition: background 0.15s ease;
}

.wpmi-suggestion-item:last-child {
  border-bottom: none;
}

.wpmi-suggestion-item.wpmi-no-results {
  color: #888;
  cursor: default;
  font-style: italic;
}

.wpmi-suggestion-item.wpmi-no-results:hover {
  background: transparent;
  color: #888;
}


/* ============================================
   5. CHECKBOXES PERSONALIZADOS
   ============================================ */

.wpmi-checks {
  margin: 22px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wpmi-check-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  position: relative;
}

.wpmi-check-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.wpmi-checkmark {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #c0c0c0;
  border-radius: 4px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, background 0.2s ease;
  margin-top: 1px;
}

/* Tilde interior del checkbox — color siempre blanco */
.wpmi-check-label input[type="checkbox"]:checked + .wpmi-checkmark::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #ffffff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}


/* ============================================
   6. MENSAJES DE ERROR Y ÉXITO
   ============================================ */

.wpmi-error {
  background: #FFF0F0;
  border: 1px solid #B22222;
  border-radius: 6px;
  color: #B22222;
  font-size: 14px;
  padding: 10px 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Éxito — base compartida */
.wpmi-success {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: 48px 24px;
}

.wpmi-success p {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.4;
}

.wpmi-success-sub {
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #555555 !important;
}

.wpmi-success-icon {
  font-size: 48px;
  margin-bottom: 20px;
  display: block;
  animation: wpmi-pulse 2s ease-in-out infinite;
}

@keyframes wpmi-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(1.08); }
}


/* ============================================
   7. BOTÓN DE ENVÍO — base compartida
   ============================================ */

.wpmi-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease, opacity 0.2s ease;
  text-align: center;
}

.wpmi-btn:active  { transform: scale(0.99); }
.wpmi-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}


/* ============================================
   8. MAPA INTERACTIVO Y CONTADOR
   ============================================ */

.wpmi-map-counter-wrap {
  text-align: center;
  margin-bottom: 16px;
}

.wpmi-counter {
  font-size: 18px;
  color: #1a1a2e;
  margin: 0;
  line-height: 1.4;
}

.wpmi-counter-num {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a2e;
  display: block;
  line-height: 1.1;
  margin-bottom: 4px;
}

.wpmi-counter-label {
  font-size: 15px;
  color: #555555;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.wpmi-map-container {
  position: relative;
  width: 100%;
  height: 500px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
}

#wpmi-map {
  width: 100%;
  height: 100%;
}

.wpmi-map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 245, 248, 0.85);
  font-size: 14px;
  color: #555555;
  z-index: 1000;
  pointer-events: none;
}

/* Tooltip del mapa */
.wpmi-tooltip {
  background: rgba(26, 26, 46, 0.92) !important;
  border: none !important;
  border-radius: 6px !important;
  color: #ffffff !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  padding: 8px 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  white-space: nowrap;
}

.wpmi-tooltip::before,
.leaflet-tooltip.wpmi-tooltip::before {
  display: none !important;
}


/* ============================================
   9. TEMA INGLÉS — Primary: #1B4F8A (azul)
                    Secondary: #B22222 (rojo)
   ============================================ */

/* Focus de inputs */
.wpmi-en input[type="text"]:focus,
.wpmi-en input[type="email"]:focus,
.wpmi-en input[type="number"]:focus,
.wpmi-en select:focus {
  border-color: #1B4F8A;
  box-shadow: 0 0 0 3px rgba(27, 79, 138, 0.12);
}

/* Flecha del select */
.wpmi-en select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231B4F8A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Borde del autocomplete */
.wpmi-en .wpmi-suggestions {
  border-color: #1B4F8A;
}

/* Hover de sugerencia */
.wpmi-en .wpmi-suggestion-item:hover,
.wpmi-en .wpmi-suggestion-item.wpmi-active {
  background: #EBF1F9;
  color: #1B4F8A;
}

/* Checkbox activo */
.wpmi-en .wpmi-check-label input[type="checkbox"]:checked + .wpmi-checkmark {
  background: #1B4F8A;
  border-color: #1B4F8A;
}

/* Borde del checkbox requerido */
.wpmi-en .wpmi-check-required .wpmi-checkmark {
  border-color: #1B4F8A;
}

/* Botón */
.wpmi-en .wpmi-btn {
  background: #1B4F8A;
}
.wpmi-en .wpmi-btn:hover {
  background: #163f6e;
}

/* Mensaje de éxito */
.wpmi-en .wpmi-success-icon,
.wpmi-success.wpmi-en .wpmi-success-icon {
  color: #1B4F8A;
}
.wpmi-en .wpmi-success p,
.wpmi-success.wpmi-en p {
  color: #1B4F8A;
}

/* Contador (opcional — si se quiere temar por landing) */
.wpmi-en .wpmi-counter-num { color: #1B4F8A; }


/* ============================================
  10. TEMA ESPAÑOL — Primary: #C9A800 (dorado)
                     Secondary: #B22222 (rojo)
   ============================================ */

/* Focus de inputs */
.wpmi-es input[type="text"]:focus,
.wpmi-es input[type="email"]:focus,
.wpmi-es input[type="number"]:focus,
.wpmi-es select:focus {
  border-color: #C9A800;
  box-shadow: 0 0 0 3px rgba(201, 168, 0, 0.15);
}

/* Flecha del select */
.wpmi-es select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23C9A800' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Borde del autocomplete */
.wpmi-es .wpmi-suggestions {
  border-color: #C9A800;
}

/* Hover de sugerencia */
.wpmi-es .wpmi-suggestion-item:hover,
.wpmi-es .wpmi-suggestion-item.wpmi-active {
  background: #FDF8DC;
  color: #8a6f00;
}

/* Checkbox activo */
.wpmi-es .wpmi-check-label input[type="checkbox"]:checked + .wpmi-checkmark {
  background: #C9A800;
  border-color: #C9A800;
}

/* Borde del checkbox requerido */
.wpmi-es .wpmi-check-required .wpmi-checkmark {
  border-color: #C9A800;
}

/* Botón */
.wpmi-es .wpmi-btn {
  background: #C9A800;
}
.wpmi-es .wpmi-btn:hover {
  background: #a88c00;
}

/* Mensaje de éxito */
.wpmi-es .wpmi-success-icon,
.wpmi-success.wpmi-es .wpmi-success-icon {
  color: #C9A800;
}
.wpmi-es .wpmi-success p,
.wpmi-success.wpmi-es p {
  color: #C9A800;
}

/* Contador */
.wpmi-es .wpmi-counter-num { color: #C9A800; }


/* ============================================
  11. TEMA FRANCÉS — Primary: #B22222 (rojo)
                     Secondary: #1B4F8A (azul)
   ============================================ */

/* Focus de inputs */
.wpmi-fr input[type="text"]:focus,
.wpmi-fr input[type="email"]:focus,
.wpmi-fr input[type="number"]:focus,
.wpmi-fr select:focus {
  border-color: #B22222;
  box-shadow: 0 0 0 3px rgba(178, 34, 34, 0.12);
}

/* Flecha del select */
.wpmi-fr select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23B22222' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Borde del autocomplete */
.wpmi-fr .wpmi-suggestions {
  border-color: #B22222;
}

/* Hover de sugerencia */
.wpmi-fr .wpmi-suggestion-item:hover,
.wpmi-fr .wpmi-suggestion-item.wpmi-active {
  background: #FFF0F0;
  color: #B22222;
}

/* Checkbox activo */
.wpmi-fr .wpmi-check-label input[type="checkbox"]:checked + .wpmi-checkmark {
  background: #B22222;
  border-color: #B22222;
}

/* Borde del checkbox requerido */
.wpmi-fr .wpmi-check-required .wpmi-checkmark {
  border-color: #B22222;
}

/* Botón */
.wpmi-fr .wpmi-btn {
  background: #B22222;
}
.wpmi-fr .wpmi-btn:hover {
  background: #8f1a1a;
}

/* Mensaje de éxito */
.wpmi-fr .wpmi-success-icon,
.wpmi-success.wpmi-fr .wpmi-success-icon {
  color: #B22222;
}
.wpmi-fr .wpmi-success p,
.wpmi-success.wpmi-fr p {
  color: #B22222;
}

/* Contador */
.wpmi-fr .wpmi-counter-num { color: #B22222; }


/* ============================================
  12. RESPONSIVE / MOBILE
   ============================================ */

/* Formularios — columna única en pantallas pequeñas */
@media (max-width: 480px) {
  .wpmi-row {
    grid-template-columns: 1fr;
  }

  .wpmi-field--age {
    max-width: 100%;
  }
}

/* Mapa — ocultar en mobile, mantener contador */
@media (max-width: 767px) {
  .wpmi-map-container {
    display: none;
  }

  .wpmi-counter-num {
    font-size: 40px;
  }

  .wpmi-counter {
    font-size: 16px;
  }
}
