/* =========================================================
   A-LEVEL DEME
   Versión 1.0.0
========================================================= */

.ademe-app {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px;
  box-sizing: border-box;
  color: #1f2937;
  font-family: Arial, Helvetica, sans-serif;
}

.ademe-app *,
.ademe-app *::before,
.ademe-app *::after {
  box-sizing: border-box;
}

/* =========================================================
   ENCABEZADO Y ETAPAS
========================================================= */

.ademe-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #6b7280;
}

.ademe-step-label {
  position: relative;
  font-weight: 500;
}

.ademe-step-label.is-active {
  color: #065a8d;
  font-weight: 700;
}

.ademe-title {
  margin: 0 0 10px;
  color: #1f2937;
  font-size: 34px;
  line-height: 1.18;
  font-weight: 700;
}

.ademe-subtitle {
  margin: 0 0 20px;
  color: #374151;
  font-size: 17px;
  line-height: 1.6;
}

.ademe-disclaimer-top {
  margin-bottom: 28px;
  padding: 16px 18px;
  background: #f5f8fb;
  border-left: 4px solid #065a8d;
  border-radius: 4px;
  color: #374151;
  font-size: 15px;
  line-height: 1.6;
}

/* =========================================================
   ETAPAS
========================================================= */

.ademe-stage[hidden] {
  display: none !important;
}

.ademe-stage {
  width: 100%;
}

/* =========================================================
   PREGUNTAS
========================================================= */

.ademe-questions {
  width: 100%;
}

.ademe-block-title {
  margin: 0 0 18px;
  color: #065a8d;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
}

.ademe-q {
  margin-bottom: 22px;
  padding: 22px;
  background: #ffffff;
  border: 1px solid #dfe5eb;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(31, 41, 55, 0.05);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.ademe-q:hover {
  border-color: #b9c8d5;
}

.ademe-q.ademe-q-missing {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.08);
}

.ademe-q-title {
  margin-bottom: 16px;
  color: #1f2937;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 700;
}

.ademe-q-opts {
  display: grid;
  gap: 10px;
}

.ademe-radio {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #d9e0e6;
  border-radius: 6px;
  color: #374151;
  font-size: 15px;
  line-height: 1.45;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.ademe-radio:hover {
  background: #f5f8fb;
  border-color: #065a8d;
}

.ademe-radio input[type="radio"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #065a8d;
  cursor: pointer;
}

.ademe-radio:has(input[type="radio"]:checked) {
  background: #edf5fa;
  border-color: #065a8d;
}

.ademe-error {
  margin-top: 12px;
  color: #b91c1c;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
}

/* =========================================================
   BOTONES Y MENSAJES
========================================================= */

.ademe-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.ademe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 22px;
  background: #065a8d;
  border: 1px solid #065a8d;
  border-radius: 5px;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

.ademe-btn:hover {
  background: #044a74;
  border-color: #044a74;
  color: #ffffff;
  transform: translateY(-1px);
}

.ademe-btn:focus-visible {
  outline: 3px solid rgba(6, 90, 141, 0.25);
  outline-offset: 2px;
}

.ademe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ademe-btn-secondary,
.ademe-prev {
  background: #ffffff;
  border-color: #9ca3af;
  color: #374151;
}

.ademe-btn-secondary:hover,
.ademe-prev:hover {
  background: #f3f4f6;
  border-color: #6b7280;
  color: #1f2937;
}

.ademe-msg {
  display: block;
  margin-top: 14px;
  min-height: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.ademe-msg.is-error {
  color: #b91c1c;
}

.ademe-msg.is-ok {
  color: #15803d;
}

/* =========================================================
   FORMULARIO DE PERSONALIZACIÓN
========================================================= */

.ademe-personalization-intro {
  margin-bottom: 24px;
  padding: 22px;
  background: #f5f8fb;
  border-radius: 8px;
}

.ademe-section-title {
  margin: 0 0 10px;
  color: #065a8d;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
}

.ademe-personalization-intro p {
  margin: 0;
  color: #374151;
  font-size: 16px;
  line-height: 1.6;
}

.ademe-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #dfe5eb;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(31, 41, 55, 0.05);
}

.ademe-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ademe-field label {
  color: #1f2937;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
}

.ademe-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #cfd7df;
  border-radius: 5px;
  color: #1f2937;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
}

.ademe-field input:focus {
  border-color: #065a8d;
  outline: none;
  box-shadow: 0 0 0 3px rgba(6, 90, 141, 0.12);
}

.ademe-field input::placeholder {
  color: #9ca3af;
}

.ademe-privacy {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.ademe-privacy-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #374151;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.ademe-privacy-label input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #065a8d;
}

.ademe-privacy-label a {
  color: #065a8d;
  text-decoration: underline;
}

.ademe-form .ademe-actions,
.ademe-form .ademe-msg {
  grid-column: 1 / -1;
}

/* =========================================================
   TARJETAS DEL REPORTE
========================================================= */

.ademe-report {
  width: 100%;
}

.ademe-card {
  width: 100%;
  margin-bottom: 22px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #dfe5eb;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(31, 41, 55, 0.05);
}

.ademe-report-title {
  margin-bottom: 16px;
  color: #1f2937;
  font-size: 21px;
  line-height: 1.3;
  font-weight: 700;
}

.ademe-report-row {
  color: #374151;
  font-size: 15px;
  line-height: 1.6;
}

/* =========================================================
   DATOS DEL USUARIO EN EL REPORTE
========================================================= */

.ademe-report-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #e1e6eb;
  border-radius: 6px;
  overflow: hidden;
}

.ademe-report-data-item {
  min-width: 0;
  padding: 14px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e1e6eb;
}

.ademe-report-data-item:nth-child(odd) {
  border-right: 1px solid #e1e6eb;
}

.ademe-report-data-item:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.ademe-report-data-label {
  margin-bottom: 5px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ademe-report-data-value {
  min-width: 0;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================================
   RESULTADOS Y GRÁFICA
========================================================= */

.ademe-results-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.ademe-gauge-wrap {
  flex: 0 0 250px;
  text-align: center;
}

.ademe-gauge-image {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  margin: 0 auto;
}

.ademe-results-content {
  flex: 1 1 320px;
  min-width: 0;
}

.ademe-report-bars-title {
  margin-bottom: 12px;
  color: #1f2937;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 700;
}

.ademe-global-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.ademe-result-separator {
  margin: 0 5px;
  color: #9ca3af;
}

.ademe-sema {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-top: 5px;
  border-radius: 50%;
}

.ademe-sema-red {
  background: #ef4444;
}

.ademe-sema-yellow {
  background: #f59e0b;
}

.ademe-sema-green-soft {
  background: #22c55e;
}

.ademe-sema-green {
  background: #16a34a;
}

.ademe-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.ademe-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.4;
}

.ademe-legend-dot {
  flex: 0 0 auto;
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

/* =========================================================
   RESULTADOS POR BLOQUE
========================================================= */

.ademe-report-blocks {
  display: grid;
  gap: 18px;
}

.ademe-report-block {
  margin-bottom: 0;
}

.ademe-block-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ademe-block-content {
  flex: 1;
  min-width: 0;
}

.ademe-block-h {
  margin: 0 0 7px;
  color: #1f2937;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
}

.ademe-block-level {
  margin: 0 0 9px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.5;
}

.ademe-block-text {
  margin: 0;
  color: #374151;
  font-size: 15px;
  line-height: 1.6;
}

/* =========================================================
   REENVÍO Y WHATSAPP
========================================================= */

.ademe-report-final {
  margin-top: 24px;
}

.ademe-report-resend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 4px;
}

.ademe-report-resend input {
  flex: 1 1 300px;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cfd7df;
  border-radius: 5px;
  color: #1f2937;
  font-family: inherit;
  font-size: 15px;
}

.ademe-report-resend input:focus {
  border-color: #065a8d;
  outline: none;
  box-shadow: 0 0 0 3px rgba(6, 90, 141, 0.12);
}

.ademe-report-divider {
  margin: 24px 0 20px;
  border: 0;
  border-top: 1px solid #e5e7eb;
}

.ademe-help-text {
  color: #065a8d;
}

.ademe-whatsapp-wrap {
  margin-top: 16px;
}

.ademe-whatsapp-btn {
  background: #25d366;
  border-color: #25d366;
  color: #ffffff;
}

.ademe-whatsapp-btn:hover {
  background: #1fb858;
  border-color: #1fb858;
  color: #ffffff;
}

/* =========================================================
   ACCESIBILIDAD
========================================================= */

.ademe-app a:focus-visible,
.ademe-app input:focus-visible,
.ademe-app button:focus-visible {
  outline: 3px solid rgba(6, 90, 141, 0.25);
  outline-offset: 2px;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 800px) {
  .ademe-app {
    padding: 26px 18px;
  }

  .ademe-title {
    font-size: 29px;
  }

  .ademe-form {
    grid-template-columns: 1fr;
  }

  .ademe-privacy,
  .ademe-form .ademe-actions,
  .ademe-form .ademe-msg {
    grid-column: auto;
  }

  .ademe-gauge-wrap {
    flex-basis: 210px;
  }
}

/* =========================================================
   MÓVIL
========================================================= */

@media (max-width: 600px) {
  .ademe-app {
    padding: 20px 14px;
  }

  .ademe-steps {
    gap: 7px 12px;
    font-size: 12px;
  }

  .ademe-title {
    font-size: 25px;
  }

  .ademe-subtitle {
    font-size: 15px;
  }

  .ademe-disclaimer-top {
    padding: 14px;
    font-size: 14px;
  }

  .ademe-block-title {
    font-size: 20px;
  }

  .ademe-q {
    padding: 17px;
  }

  .ademe-q-title {
    font-size: 16px;
  }

  .ademe-radio {
    padding: 11px 12px;
    font-size: 14px;
  }

  .ademe-actions {
    flex-direction: column-reverse;
  }

  .ademe-actions .ademe-btn {
    width: 100%;
  }

  .ademe-form {
    padding: 18px;
  }

  .ademe-personalization-intro {
    padding: 18px;
  }

  .ademe-section-title {
    font-size: 21px;
  }

  .ademe-card {
    padding: 18px;
  }

  .ademe-report-data-grid {
    grid-template-columns: 1fr;
  }

  .ademe-report-data-item {
    border-right: 0 !important;
    border-bottom: 1px solid #e1e6eb !important;
  }

  .ademe-report-data-item:last-child {
    border-bottom: 0 !important;
  }

  .ademe-results-layout {
    display: block;
  }

  .ademe-gauge-wrap {
    width: 100%;
    margin-bottom: 18px;
  }

  .ademe-result-separator {
    display: none;
  }

  .ademe-global-row > div:last-child {
    display: grid;
    gap: 3px;
  }

  .ademe-legend {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ademe-report-resend {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ademe-report-resend .ademe-btn {
    width: 100%;
  }
}