/* /public/css/styles.css */

/*
  Nota: Para evitar que este CSS afecte el header/navbar de WordPress,
  todas las reglas están scopeadas bajo el contenedor `.mpp-scope`.
  En tu página, envuelve el formulario con un div que tenga esa clase:
  <div class="mpp-scope"> ... tu formulario ... </div>
*/

/* ====== FORM BASE (scope: .mpp-scope) ====== */
.mpp-scope .mpp-form {
  max-width: 720px;
  margin: 1rem auto;
  line-height: 2;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}

.mpp-scope .mpp-row {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
}

.mpp-scope .mpp-row label {
  font-weight: 600;
  margin-bottom: .25rem;
  line-height: 2;
  color: white;
}

.mpp-scope .mpp-row input,
.mpp-scope .mpp-row select {
  padding: .5rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  caret-color: #fff;
}

/* Estilo mejorado para selects: esquinas curvas y formato */
.mpp-scope .mpp-row select {
  border-radius: 12px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #ffffff;
  color: #111;
  border: 1px solid #ddd;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23333' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.main-page-wrapper {
  background: url('./img/background.png') center/cover no-repeat fixed !important;
  color: #fff;
}

.mpp-scope .mpp-row select:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 3px rgba(34, 113, 177, .2);
}

/* ====== CUSTOM SELECT (reemplaza popup nativo) ====== */
/* Oculta de forma accesible el select nativo, pero deja sus valores para el form */
.mpp-scope .mpp-select-native,
.mpp-scope .mpp-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.mpp-scope .mpp-custom-select {
  position: relative;
  width: 100%;
  font-family: 'Poppins', sans-serif;
  font-weight: 20;
}

.mpp-scope .mpp-select-toggle {
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: .5rem .40rem;
  padding-right: 2rem;
  border-radius: 12px;
  background: #ffffff;
  color: #111;
  border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  transition: box-shadow .2s ease, transform .15s ease;
}

.mpp-scope .mpp-select-toggle:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, .10);
  transform: translateY(-1px);
}

.mpp-scope .mpp-select-toggle:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 3px rgba(34, 113, 177, .2);
}

.mpp-scope .mpp-select-toggle::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 6px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23333' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 10px 6px;
}

.mpp-scope .mpp-select-wrap {
  position: relative;
}

.mpp-scope .mpp-select-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  background: #fff;
  color: #111;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
  max-height: 260px;
  overflow: auto;
  z-index: 20;
  display: none;
  padding: .25rem 0;
}

.mpp-scope .mpp-custom-select.is-open .mpp-select-list {
  display: block;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.mpp-scope .mpp-custom-select.is-open .mpp-select-toggle {
  transform: none;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.mpp-scope .mpp-select-option {
  list-style: none;
  padding: .35rem .5rem;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1.25;
}

.mpp-scope .mpp-select-option:hover,
.mpp-scope .mpp-select-option[aria-selected="true"] {
  background: #f0f6fb;
}

.mpp-scope .mpp-select-option:focus {
  outline: none;
  background: #e4f0f9;
}

/* Asegurar tamaños en móvil */
@media (max-width: 768px) {
  .mpp-scope .mpp-select-list {
    max-height: 50vh;
  }
}

.mpp-scope .mpp-btn {
  padding: .6rem 1rem;
  border: 0;
  border-radius: 6px;
  background: #8d0522;
  color: #fff;
  cursor: pointer;
}

.mpp-scope .mpp-btn:hover {
  transform: translateY(-3px);
  background: rgba(61, 0, 0, 0.829);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.mpp-scope .mpp-btn[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

.mpp-scope .mpp-message {
  margin-top: .75rem;
}

.mpp-scope .mpp-error {
  color: #c21d1d;
  font-size: .85rem;
  min-height: 1em;
  margin-top: .25rem;
}

.mpp-scope .mpp-inline {
  margin-right: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.mpp-scope fieldset.mpp-step {
  border: 1px dashed #bbb;
  padding: .75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  color: white;
}

.mpp-scope .mpp-help {
  color: #666;
  font-size: .8rem;
  margin-top: .2rem;
}

/* Texto específico del label de Términos: reducir al 50% */
.mpp-scope .mpp-terms-label {
  font-size: 0.5em;
  line-height: 1.4;
}

.mpp-scope .mpp-terms-label a {
  font-size: inherit;
}

/* ====== FONDO (scope en contenedor, no body) ====== */
.mpp-scope {
  /* habilita scroll vertical y previene horizontal sólo en el contenedor */
  min-height: 100vh;
  background: url('./img/background.png') center/cover no-repeat fixed !important;
  animation: gradientBG 15s ease infinite;
  overflow-x: hidden;
  overflow-y: auto;
  color: #fff;
  font-family: 'Poppins', system-ui, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 20% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* ====== SIDEBAR ====== */
.mpp-scope .sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 230px;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  padding-top: 30px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mpp-scope .logo {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 40px;
}

.mpp-scope .menu {
  list-style: none;
  padding: 0;
  width: 100%;
}

.mpp-scope .menu li {
  width: 100%;
}

.mpp-scope .menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 25px;
  color: #fff;
  text-decoration: none;
  transition: .3s;
}

.mpp-scope .menu a:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mpp-scope .menu i {
  width: 25px;
  font-size: 18px;
  text-align: center;
}

/* ====== CONTENIDO ====== */
.mpp-scope .content {
  /* Por qué: deja espacio para el sidebar y permite que el contenido crezca verticalmente con scroll */
  margin-left: 250px;
  padding: 16px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* que el hijo (form-container) pueda centrarse con margin auto */
  justify-content: flex-start;
  width: calc(100% - 250px);
  box-sizing: border-box;
}

/* Título */
.mpp-scope .title-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  color: #fff !important;
}

.mpp-scope .title-block h1 {
  font-size: clamp(1.4rem, 2.5vw + 1rem, 2.4rem);
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  text-align: center;
  color: #fff !important;
}

.mpp-scope .title-block p {
  margin: 4px 0 0 0;
  font-size: 1.1rem;
  text-align: center;
  color: rgba(255, 255, 255, .9);
  color: #fff !important;
}

/* Header del formulario: misma anchura/padding que el contenedor */
.mpp-scope .form-header {
  width: 100%;
  max-width: 820px;
  margin: 0 auto 4px;
  padding: 0 28px;
  box-sizing: border-box;
  color: #fff !important;
}

/* ====== FORM GLASS CONTAINER ====== */
.mpp-scope .form-container {
  /* Por qué: antes 80vh + overflow ocultaba y evitaba scroll; lo dejamos crecer y lo centramos */
  width: 100%;
  max-width: 820px;
  /* ancho del card */
  height: auto;
  /* deja que el contenido determine la altura */
  margin: 12px auto;
  /* centra horizontal */
  padding: 28px;
  border-radius: 20px;
  overflow: visible;
  /* no recortar el contenido */
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Asegura que el padding no sume al 100% de ancho */
.mpp-scope .form-container {
  box-sizing: border-box;
}

/* Iframe/report (sin cambios funcionales) */
.mpp-scope .report-view iframe {
  width: 90%;
  height: 80vh;
  border-radius: 12px;
  margin-top: 20px;
}

/* Botones (sin cambios) */
.mpp-scope .open-report,
.mpp-scope .btn-group button {
  padding: 10px 20px;
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 8px;
  transition: .3s;
}

.mpp-scope .open-report:hover,
.mpp-scope .btn-group button:hover {
  background: rgba(255, 255, 255, 0.4);
}

.mpp-scope .btn-enviar {
  padding: 10px 20px;
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 8px;
  transition: .3s;
}

/* ====== COSAS ABSOLUTAS (si usas icon-button-grid) ====== */
/* Por qué: al estar absolute ya no afectan el flujo; ojo que pueden tapar el form si se superponen */
.mpp-scope .icon-button-grid {
  position: absolute;
  top: 200px;
  left: 300px;
  display: flex;
  flex-wrap: wrap;
  gap: 60px;
  align-content: flex-start;
}

.mpp-scope .icon-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 130px;
  height: 130px;
  border-radius: 25px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform .25s, background .25s, box-shadow .25s;
  flex: 0 0 auto;
}

.mpp-scope .icon-button:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.mpp-scope .icon-button .material-icons {
  font-size: 42px;
  color: #fff;
  margin-bottom: 8px;
}

.mpp-scope .icon-button span {
  font-size: .9rem;
  color: #fff;
  font-weight: 500;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 992px) {
  .mpp-scope .content {
    margin-left: 250px;
    width: calc(100% - 250px);
    padding: 12px 16px;
  }

  .mpp-scope .form-container {
    margin: 10px auto;
    padding: 20px;
  }
}

@media (max-width: 768px) {

  /* Por qué: en móviles, el sidebar pasa arriba y el contenido ocupa el ancho completo */
  .mpp-scope .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 16px;
  }

  .mpp-scope .content {
    margin-left: 0;
    width: 100%;
    padding: 10px;
  }

  /* Garantiza un gutter lateral de 16px aunque el padre no tenga padding */
  .mpp-scope .form-container {
    max-width: calc(100% - 32px);
    margin: 10px auto;
    padding: 20px;
  }

  .mpp-scope .form-header {
    max-width: calc(100% - 32px);
    padding: 0 20px;
  }
}
