/* === General === */
body{
    background-color: #F5F5F5;
}

h1 {
    text-align: center;
    color: black;
    font-size: 32px;
    font-weight: 600;
}
h2 {
    margin: 0;
    text-align: center;
    color: black;
    font-size: 32px;
    font-weight: 600;
}

.row{
    justify-content: space-between;
}

#multi-step-form-container {
    margin-top: 5rem;
}
.text-center {
    text-align: center;
}
.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.mx-2{
   /* width: 50% !important;*/
}
.pl-0 {
    padding-left: 0;
}
.button {
    padding: 0.7rem 1.5rem;
    border: 0 !important;
    background-color: #00b9e9;
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
}
.button:hover {
    background-color: #0079AD;
    color: #fff;
}

input.button{
    color:#333;
}

.submit-btn {
    border: 1px solid #bdbdbd;
    background-color: #bdbdbd;
}
.mt-3 {
    margin-top: 2rem;
}
.d-none {
    display: none;
}
.form-step {
    border-radius: 20px;
    padding: 0 3rem;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto !important;
}
.font-normal {
    font-weight: normal;
}
ul.form-stepper {
    counter-reset: section;
    margin-bottom: 3rem;
}
ul.form-stepper .form-stepper-circle {
    position: relative;
}
ul.form-stepper .form-stepper-circle span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateY(-50%) translateX(-50%);
}
.form-stepper-horizontal, .form-stepper-horizontal-2 {
    position: relative;
    display: flex;
    justify-content: space-between;
    max-width: 1280px;
    width: 100%;
}
ul.form-stepper > li:not(:last-of-type), .form-stepper-horizontal-2 > li:not(:last-of-type)  {
    margin-bottom: 0.625rem;
    transition: margin-bottom 0.4s;
}
.form-stepper-horizontal > li:not(:last-of-type) {
    margin-bottom: 0 !important;
}
.form-stepper-horizontal li, .form-stepper-horizontal-2 li {
    position: relative;
    display: flex;
    flex: 1;
    align-items: start;
    transition: 0.5s;
}
.form-stepper-horizontal li:last-child{
    flex:none;
}
.form-stepper-horizontal li:last-child a{
    width: 160px !important;
}
.form-stepper-horizontal li:not(:last-child):after {
    position: relative;
    flex: 1;
    height: 1px;
    content: "";
    top: 32%;
    background-color: #00b9e9 !important; /* línea azul corporativo */
}
.form-stepper-horizontal li.form-stepper-completed:after {
    background-color: #00b9e9 !important;
}

ul.form-stepper li a .form-stepper-circle {
    display: inline-block;
    width: 40px;
    height: 40px;
    margin-right: 0;
    line-height: 1.7rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.38);
    border-radius: 50%;
}
.form-stepper .form-stepper-active .form-stepper-circle {
  background-color: #000 !important;
  color: #fff;
}

.form-stepper .form-stepper-active .form-stepper-circle span {
  color: #fff !important;            /* número en blanco */
  font-weight: 700;
}
.form-stepper .form-stepper-active .label {
  color: #000 !important; /* texto negro */
  font-weight: 700;
}


/* Paso COMPLETADO */
.form-stepper .form-stepper-completed .form-stepper-circle {
  background-color: #00b9e9 !important;
  color: #fff;
  position: relative;
}
.form-stepper .form-stepper-completed .form-stepper-circle span {
  display: none; /* ocultar número */
}
.form-stepper .form-stepper-completed .form-stepper-circle::after {
  content: "✔";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: bold;
  color: #fff;
}
.form-stepper .form-stepper-completed .label {
  color: #000 !important; /* texto negro */
}

/* Paso PENDIENTE */
.form-stepper .form-stepper-unfinished .form-stepper-circle {
  background-color: #e0e0e0 !important;
  color: #9e9e9e !important;
}
.form-stepper .form-stepper-unfinished .label {
  color: #9e9e9e !important; /* gris claro */
}

canvas {
    width: 100%!important;
    float: left;
    height: auto !important;
}

.pregunta p{
    font-weight: bold;
}

@media (min-width: 769px) {
    canvas {
        width: 600px !important;
        height: 601px !important;
        float: none;
        margin: 0 auto;
    }
}

.resposta{
    transition: all 0.5s;
    border-radius: 10px;
    padding: 3px 6px;
    border: 1px solid transparent;
    font-weight: 700;
    color: #000;
}

.resposta.vermell, .llum-vermella {
    color: #3d3d3d
}
.resposta.taronja, .llum-taronja {
    color: #3d3d3d;
}
.resposta.verd, .llum-verda {
    color: #3d3d3d;
}
.resposta.gris {
    background-color: #d3d3d354;
    border: 1px solid #80808038;
}

.apartat-resum .col-9{
    height: 249px;
}

ol li{
    margin-top: 32px;
}

.previ{
    position: absolute;
    top: -19999px;
}

select{
    height: 50px;
    border-radius: 8px;
    border: 1px solid #808080;
    background: #FFF;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
    color: #242424;
    font-family: 'Assistant';
    font-size: 20px;
    font-style: normal;
    line-height: normal;
    padding-left: 20px;
    width: 100%;
}

.select2{
    width: 100% !important;
    height: 50px !important;
}
.select2-container .select2-selection--single{
    height: 50px !important;
}
.select2-container .select2-selection--single .select2-selection__rendered{
    padding: .75rem 1rem;
}

.pregunta{
    width: 45%;
}
.pregunta-3col{
    width: 17.5%;
}
.pregunta-altres{
    width: 31%;
}
.altres-energia{
    margin-top: 32px;
}
.row.gassos, .row.combustible {
    margin-top: 28px;
}
.energia-1, .energia-2, .energia-3, .energia-4 ,.energia-5, .gassos-1, .combustible-1{
    display: none;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-width: 10px 9px 0 9px !important;
    margin-left: -20px !important;
    margin-top: 8px !important;
}

p{
    font-weight: 700 !important;
    color:#000;
}

.btn-check{
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.btn-ibe{
    font-family: 'Assistant';
    font-style: normal;
    font-weight: 500;
    background-color: #00b9e9;
    padding-top: 1px;
    color: #fff;
    border: 0;
    padding: 0.55rem 0.8rem;
    border-radius: 10px;
}
.btn-ibe:hover {
    background-color: #0079AD;
}

.btn-check {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

/* === BOTONES TIPO RADIO (Sí/No) VISIBLES === */
.btn-ibe {
  font-family: 'Assistant';
  font-style: normal;
  font-weight: 600;
  background: #fff;               
  color: #00b9e9;                  
  border: 1px solid #00b9e9;       
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 64px;
  text-align: center;
}

.btn-ibe:hover {
  background: #e9f8fd;             
  color: #0079AD;                  
  border-color: #00b9e9;
}

/* Estado seleccionado */
.btn-check:checked + .btn-ibe,
.btn-check:active + .btn-ibe {
  background: #00b9e9;             
  color: #fff;                     
  border-color: #00b9e9;
  box-shadow: 0 0 0 4px rgba(0,185,233,0.18);
}

/* Accesibilidad: focus visible */
.btn-ibe:focus-visible {
  outline: 2px solid #00b9e9;
  outline-offset: 2px;
}


.btn-navigate-form-step{
    float: right;
    margin-right: 150px;
    border-radius: 10px;
    background: #00B9E9;
    border: 0 !important;
    color: #fff;
    font-weight: 500;
}
.btn-navigate-form-step:hover {
    background-color: #0079AD;
}

/* Alineación botones en step3 */
.step3-buttons {
  display: flex;
  justify-content: space-between; /* uno a la izq, otro a la der */
  align-items: center;
  margin-top: 20px;
}

.step3-buttons .btn-back {
  margin-right: auto;  
}

.step3-buttons .btn-download {
  margin-left: auto;   
}

/* Animación de pulso */
@keyframes pulse {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,185,233,0.4); }
  70%  { transform: scale(1.02); box-shadow: 0 0 0 12px rgba(0,185,233,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,185,233,0); }
}

.btn-download {
  background-color: #00b9e9;
  color: #fff;
  font-weight: 600;
  font-size: 16px;           /* más pequeño que antes */
  padding: 10px 22px;        /* más compacto */
  border-radius: 10px;       /* esquinas un poco más cerradas */
  border: none;
  box-shadow: 0 4px 8px rgba(0,185,233,0.25);
  transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  animation: pulse 4s infinite; /* palpita lento */
}

/* Hover atractivo */
.btn-download:hover {
  background-color: #0079AD;                 /* azul más oscuro */
  transform: scale(1.05);                    /* expansión ligera */
  box-shadow: 0 6px 14px rgba(0,121,173,0.35); /* sombra más marcada */
}

.resumen-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
  padding: 16px 18px;
  margin-top: 20px;
  color: #000;
}
.resumen-card .card-title {
  font-weight: 700;
  font-size: 1.25rem;
  color: #000; /* destacar título */
}
.kv > div {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #eee;
}
.kv > div:last-child { border-bottom: 0; }
.kv .k { color: #000; font-weight: 700; }
.kv .v { font-weight: 700; color: #000; }

.total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 12px 0;
  padding: 10px 12px;
  background: #f7fdff;
  border: 1px solid #d7f4fc;
  border-radius: 10px;
  color: #000;
}
.total-label { font-weight: 700; color: #000; }
.total-value { font-size: 1.25rem; font-weight: 800; color: #000; }
.tabla { width: 100%; border-collapse: collapse; font-size: 0.95rem; color: #000; }
.tabla th, .tabla td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; }
.tabla thead th { text-align: left; background: #fafafa; font-weight: 700; }
.tabla .right { text-align: right; }

/* --- Footer fijo --- */
:root { --calc-footer-space: 70px; }

.calc-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: #00b9e9;
  border-top: 1px solid #ddd;
  padding: 12px 20px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
}
body.calc-footer-visible,
#multi-step-form-container.calc-footer-visible,
.form-step.calc-footer-visible {
  padding-bottom: var(--calc-footer-space);
}
@media (max-width: 576px) {
  :root { --calc-footer-space: 90px; }
  .calc-footer { font-size: 14px; }
}

/* === form-control focus === */
.form-control:focus,
select:focus {
  color: #666666;
  border-color: #00b9e9;
  box-shadow: 0 0 0 0.2rem rgba(0, 185, 233, 0.25);
}

/* Mostrar un check en los pasos completados */
.form-stepper .form-stepper-completed .form-stepper-circle {
  background-color: #00b9e9 !important; /* azul corporativo */
  color: #fff;
  position: relative;
}

.form-stepper .form-stepper-completed .form-stepper-circle span {
  display: none; /* ocultamos el número */
}

.form-stepper .form-stepper-completed .form-stepper-circle::after {
  content: "✔";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: bold;
  color: #fff;
}

/* Botonera uniforme */
.step-buttons {
  display: flex;
  justify-content: space-between;   /* Enrere izq / Següent dcha */
  align-items: center;
  margin-top: 20px;
}

.step-buttons .btn-navigate-form-step {
  float: none;
  margin-right: 0;
}

/* ===== Modal Cecot ===== */
.modal-cecot {
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.15);
  overflow: hidden;
  background: #fff;
}

/* Header */
.modal-cecot .modal-header {
  border-bottom: 1px solid #eef2f4;
  background: #fafafa;
  padding: 14px 18px;
}
.modal-cecot .modal-title {
  margin: 0;
  color: #000;
  font-weight: 700;
  font-size: 20px;
}
.modal-cecot .close {
  outline: none;
}
.modal-cecot .close span {
  font-size: 28px;
  line-height: 1;
}

/* Body */
.modal-cecot .modal-body {
  padding: 18px;
}
.modal-cecot label {
  font-weight: 700;
  color: #000;
}
.modal-cecot .form-control {
  border-radius: 8px;
}

/* Links del aviso legal con color corporativo */
.modal-cecot .form-check-label a {
  color: #00b9e9;
  text-decoration: underline;
}
.modal-cecot .form-check-input:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0,185,233,0.15);
  border-color: #00b9e9;
}

/* Footer: botones alineados a derecha con gap */
.modal-footer-cta {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #eef2f4;
  padding: 12px 18px;
}

/* Botones del modal con el mismo estilo global */
.btn-modal-primary {
  background: #00b9e9;
  color: #fff;
  border: 0 !important;
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  transition: background-color .2s ease, transform .1s ease, box-shadow .2s ease;
}
.btn-modal-primary:hover {
  background: #0079AD;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,121,173,0.25);
}

/* Secundario: blanco con borde azul (consistente con radios Sí/No) */
.btn-modal-secondary {
  background: #fff;
  color: #00b9e9;
  border: 1px solid #00b9e9 !important;
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  transition: background-color .2s ease, color .2s ease, transform .1s ease;
}
.btn-modal-secondary:hover {
  background: #e9f8fd;
  color: #0079AD;
  transform: translateY(-1px);
}

/* Asegurar que los botones no hereden estilos no deseados */
.modal-footer-cta .button {
  margin: 0;
  float: none;
}

.descarga-copy{
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.4;
  margin: 1rem 0 1.25rem;
}


/* ==========
   MOBILE FIRST OVERRIDES (añadir al final)
   Se aplican en ≤ 768px sin eliminar estilos previos
   ========== */
@media (max-width: 768px) {

  /* Espaciado y tipografías fluidas */
  html, body { overflow-x: hidden; }
  #multi-step-form-container { margin-top: 2rem; padding: 0 16px; }
  .form-step { padding: 1rem 1.25rem; border-radius: 16px; }

  h1, h2 {
    font-size: clamp(22px, 6vw, 28px);
    line-height: 1.2;
    margin: 0 0 0.5rem 0;
  }

  /* Fila a columna y respiros */
  .row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px;
    flex-wrap: wrap;
  }

  /* Anchos de bloques de pregunta: a 100% */
  .pregunta,
  .pregunta-3col,
  .pregunta-altres {
    width: 100% !important;
  }

  .altres-energia,
  .row.gassos,
  .row.combustible {
    margin-top: 16px;
  }

  /* Inputs grandes para evitar zoom en iOS y mejorar accesibilidad */
  input, select, textarea, .select2-selection__rendered {
    font-size: 16px !important;
  }

  /* Select2 ajuste de alto y paddings */
  .select2,
  .select2-container,
  .select2-container .select2-selection--single {
    width: 100% !important;
    min-width: 0;
    height: 48px !important;
  }
  .select2-container .select2-selection--single .select2-selection__rendered {
    padding: 0.6rem 0.9rem !important;
    line-height: 1.2 !important;
  }

  /* Stepper horizontal -> pila vertical centrada en móvil */
  .form-stepper-horizontal,
  .form-stepper-horizontal-2 {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .form-stepper-horizontal li,
  .form-stepper-horizontal-2 li {
    flex: none !important;
    width: 100%;
    justify-content: center;
  }
  .form-stepper-horizontal li:not(:last-child)::after {
    /* Oculta la línea horizontal del conector en móvil */
    content: none !important;
  }
  ul.form-stepper li a .form-stepper-circle {
    width: 36px;
    height: 36px;
    line-height: 36px;
    margin-right: 8px;
  }

  /* Botonera: botones a ancho completo y sin floats */
  .button,
  .btn-ibe,
  .btn-navigate-form-step,
  .btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;         /* objetivo táctil recomendado */
    margin: 8px 0;
  }
  .btn-navigate-form-step {
    float: none !important;
    margin-right: 0 !important;
  }

  /* Grupo de botones step3 en columna */
  .step3-buttons {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .step3-buttons .btn-back,
  .step3-buttons .btn-download {
    margin: 0 !important;
    width: 100%;
  }

  /* Tarjetas/resumen: respiración y textos */
  .resumen-card {
    padding: 14px 14px;
  }
  .kv > div { padding: 6px 0; }
  .total { padding: 10px; }
  .total-value { font-size: 1.1rem; }

  /* Tablas: desplazamiento horizontal suave si hace falta */
  .tabla {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  /* Canvas ya es responsive; solo centrado */
  canvas { margin: 0 auto; }

  /* Altura fija problemáticas -> auto en móvil */
  .apartat-resum .col-9 { height: auto !important; }

  /* Elementos ocultos para previsualización */
  .previ { position: absolute; top: -9999px; }

  /* Footer fijo: respeta safe-area (iPhone) y aumenta padding inferior */
  :root { --calc-footer-space: 90px; }
  .calc-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  body.calc-footer-visible,
  #multi-step-form-container.calc-footer-visible,
  .form-step.calc-footer-visible {
    padding-bottom: calc(var(--calc-footer-space) + env(safe-area-inset-bottom));
  }
}

/* Ajustes extra para pantallas muy pequeñas (≤ 576px) */
@media (max-width: 576px) {
  .form-step { padding: 0.9rem 1rem; }
  .kv .k, .kv .v, p { font-weight: 600 !important; } /* mantiene jerarquía con menos "peso visual" */
  .btn-download { font-size: 15px; padding: 10px 18px; }
  .modal-cecot .modal-body { padding: 14px; }
  .modal-cecot .modal-title { font-size: 18px; }
}

/* Mejoras táctiles generales (no destructivas) */
* { -webkit-tap-highlight-color: rgba(0,0,0,0); }
button, .button, .btn-ibe, .btn-download { touch-action: manipulation; }


/* === FIX Sí/No en móvil (sin tocar el resto) === */
@media (max-width: 768px) {
  /* Mantén ancho completo solo para acciones principales */
  .button,
  .btn-navigate-form-step,
  .btn-download {
    width: 100%;
  }

  /* Los radios visibles (Sí/No) deben ir en línea */
  .btn-ibe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;            /* <- deja de ocupar 100% */
    min-width: 96px;        /* tamaño táctil cómodo */
    margin: 0;              /* limpiamos márgenes heredados */
  }
  /* separador entre Sí y No */
  .btn-ibe + .btn-ibe { margin-left: 8px; }

  /* Intenta forzar un contenedor en fila para los dos botones,
     cubriendo los casos más comunes de HTML */
  .btn-group,
  .form-check,
  .form-check-inline,
  .yesno,
  .multiseu,                /* por el campo "Multiseu" de tu formulario */
  .opciones,
  .options {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
  }

  /* Evita que otro input se “meta” debajo del No */
  .btn-group .btn-ibe,
  .form-check .btn-ibe,
  .form-check-inline .btn-ibe,
  .yesno .btn-ibe,
  .multiseu .btn-ibe {
    flex: 1 1 0;            /* que repartan el espacio */
  }

  /* Inputs que estén en esa fila mantienen 100% bajo su bloque */
  .pregunta input[type="text"],
  .pregunta input[type="number"],
  .pregunta select {
    width: 100%;
  }
}

