/*
 * Lanzadera Mensajes. Mensajes de PMPro (perfil actualizado, sesión cerrada, errores, avisos)
 * y de la pantalla de acceso de WordPress, con los colores de marca: blanco, verde #81d742 y negro.
 */

/* Base */
body .pmpro_message,
body .pmpro_content_message,
.login .message,
.login .success,
.login #login_error {
  --lm-c: #111;
  --lm-bg: #f6f8f4;
  --lm-borde: #d9ded6;
  --lm-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='14' fill='%23111111'/%3E%3Ccircle cx='14' cy='8.5' r='1.9' fill='%23fff'/%3E%3Cpath d='M14 12.5v8' stroke='%23fff' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  box-sizing: border-box;
  margin: 0 0 24px;
  padding: 18px 56px 18px 68px;
  border: 1px solid var(--lm-borde);
  border-left: 6px solid var(--lm-c);
  border-radius: 16px;
  background: var(--lm-bg);
  color: #111;
  font-size: 1.05rem;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .07);
}
body .pmpro_message::before,
body .pmpro_content_message::before,
.login .message::before,
.login .success::before,
.login #login_error::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  background: var(--lm-icono) center / contain no-repeat;
}
body .pmpro_message:empty,
body .pmpro_message.pmpro_hidden,
body .pmpro_message[hidden] {
  display: none !important;
}

/* Variantes */
body .pmpro_message.pmpro_success,
.login .success {
  --lm-c: #81d742;
  --lm-bg: #f2fbe9;
  --lm-borde: #cfe9b6;
  --lm-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='14' fill='%2381d742'/%3E%3Cpath d='M8 14.5l4 4 8-9' fill='none' stroke='%23111' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
body .pmpro_message.pmpro_error,
.login #login_error {
  --lm-c: #d93025;
  --lm-bg: #fdf0ef;
  --lm-borde: #f3c9c5;
  --lm-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='14' fill='%23d93025'/%3E%3Cpath d='M9 9l10 10M19 9L9 19' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}
body .pmpro_message.pmpro_alert,
body .pmpro_message.pmpro_warning,
.login .message {
  --lm-c: #f5a623;
  --lm-bg: #fff8ec;
  --lm-borde: #f6dcae;
  --lm-icono: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='14' fill='%23f5a623'/%3E%3Cpath d='M14 7v9' stroke='%23111' stroke-width='3' stroke-linecap='round'/%3E%3Ccircle cx='14' cy='20.5' r='1.9' fill='%23111'/%3E%3C/svg%3E");
}

/* Enlaces dentro del mensaje: botón */
body .pmpro_message a,
body .pmpro_content_message a,
.login .message a,
.login .success a {
  display: inline-flex !important;
  align-items: center;
  margin-left: auto;
  padding: 9px 20px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #111 !important;
  color: #fff !important;
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
body .pmpro_message a:hover,
body .pmpro_message a:focus-visible,
body .pmpro_content_message a:hover,
.login .message a:hover,
.login .success a:hover {
  background: #81d742 !important;
  color: #111 !important;
}
body .pmpro_message a:focus-visible {
  outline: 3px solid #111;
  outline-offset: 3px;
}

/* Botón de cerrar (lo añade mensajes.js) */
.lm-msg-cerrar {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 36px;
  height: 36px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #111;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.lm-msg-cerrar:hover { background: rgba(0, 0, 0, .08); }
.lm-msg-cerrar:focus-visible { outline: 3px solid #111; outline-offset: 2px; }
.lm-msg-oculto { opacity: 0; transform: translateY(-6px); }
@media (prefers-reduced-motion: no-preference) {
  body .pmpro_message { transition: opacity .2s ease, transform .2s ease; }
}

/* Móvil: el botón pasa debajo del texto, a todo el ancho */
@media (max-width: 640px) {
  body .pmpro_message,
  body .pmpro_content_message {
    padding: 16px 48px 16px 60px;
    font-size: 1rem;
  }
  body .pmpro_message::before,
  body .pmpro_content_message::before { left: 16px; width: 26px; height: 26px; }
  body .pmpro_message a,
  body .pmpro_content_message a {
    justify-content: center;
    width: 100%;
    margin-left: 0;
    white-space: normal;
  }
}
