:root {
  --cemcat-primary: #0b7f86;
  --cemcat-secondary: #cfe9eb;
  --cemcat-bg: #eef7f8;
  --cemcat-text: #243333;
}

body {
  background: var(--cemcat-bg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont;
  color: var(--cemcat-text);
}

.cemcat-header h1 {
  color: var(--cemcat-primary);
}

.cemcat-btn-primary {
  background: var(--cemcat-primary);
  color: white;
  border-radius: 28px;
  padding: 14px 36px;
  font-size: 16px;
  border: none;
  cursor: pointer;
}

.survey-list li {
  background: white;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.survey-list li.locked {
  opacity: 0.4;
}
@font-face {
  font-family: "DIN";
  src: url("fonts/D-DIN.woff2") format("woff2"),
    url("fonts/D-DIN.woff") format("woff"),
    url("fonts/D-DIN.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "DIN";
  src: url("fonts/D-DIN-Bold.woff2") format("woff2"),
    url("fonts/D-DIN-Bold.woff") format("woff"),
    url("fonts/D-DIN-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

:root {
  --font-family: "DIN", sans-serif;
  --white: #FFFFFF;
  --primary: #00788A;
  --primary-100: #CCE4E8;
  --primary-700: #004853;
  --gray-900: #181818;
}


.sd-error {
  border-radius: 4px;
}


#sp_6 .sd-body__page>.sd-page__row:not(:first-child) {
  padding-left: 50px;
  padding-right: 50px;
}
.sd-row.sd-page__row .sd-panel {
    padding-left: 20px;
    padding-right: 20px;
}

.button-completepage {
  margin-top: 50px;
}

.sd-completedpage a,
.sd-body--loading a,
.sd-completed-before-page a {
  color: var(--white);
  text-decoration: none;
  margin-top: 20px;
}

.sd-body.sd-body--responsive .sd-body__navigation {
  padding-left: 50px;
  padding-right: 50px;
  display: flex;
  justify-content: center;
}

.sd-matrix__cell:first-of-type {
  font-weight: 400;
}


/*Bienvenido*/
header {
  background-color: var(--white);
  padding: 50px 50px 0 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

header .texto {
  width: 30%;
}

header .img {
  width: auto;
  height: auto;
}

header .img img {
  max-width: 100%;
}

header .bienvenida {
  font-size: 22px;
}


.sd-html h1 {
  font-weight: 700;
  color: var(--primary);
  font-size: 3rem;
  line-height: 2%;
}

.agradecimiento {
  max-width: 60%;
  margin: 0 auto;
}

.agradecimiento .img,
.agradecimiento img {
  width: auto;
  height: auto;
}

.img-agradecimiento {
  padding-top: 20px;
}

.agradecimiento .img img,
.agradecimiento img {
  max-width: 100%;
}

.sd-completedpage h1 {
  font-weight: 700;
  color: var(--primary);
  font-size: 3rem;
  line-height: 80%;
}

.sd-completedpage p {
  color: var(--gray-900);
  font-size: 22px;

}

.sd-html h2 {
  font-weight: 700;
  color: var(--gray-900);
  font-size: 2rem;
  line-height: 2%;
}

#header {
  background-color: transparent;
  padding: 30px 0 0 0;
}

#header .emojis {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}

ul li {
  list-style-type: none;
}

.sd-panel__content {
  padding-top: 0;
}

.sd-btn {
  background-color: var(--primary);
  color: var(--white);
  transition: all 0.5s ease-in-out;
  border: var(--primary) 2px solid;
  text-transform: uppercase;
  border-radius: 100px;
}

.sd-action-bar {
  justify-content: center;
}

.sd-btn:hover {
  background-color: var(--primary-700);
  transition: all 0.5s ease-in-out;
}

.sd-btn:focus {
  border: var(--gray-900) 2px solid;
  transition: all 0.5s ease-in-out;
}

.sd-btn.sd-navigation__prev-btn,
.sd-btn--small {
  background-color: var(--primary-100);
  color: var(--primary);
  border: var(--primary) 2px solid;
  transition: all 0.5s ease-in-out;
}

.sd-btn.sd-navigation__prev-btn:hover,
.sd-btn--small:hover {
  color: var(--white);
  background-color: var(--primary);
  transition: all 0.5s ease-in-out;

}

.sd-btn--small {
  font-size: 14px;
}

/*Tablets*/
@media (max-width: 1280px) {
  header .texto {
    width: 60%;
  }

  header .img {
    width: 40%;
    height: auto;
  }

  .sd-completedpage {
    padding: 50px;
  }

  .agradecimiento {
    max-width: 80%;
  }
}


@media (max-width: 768px) {
  header .texto {
    width: 50%;
  }

  header .img {
    width: 50%;
    height: auto;
  }

  .sd-html h1,
  .sd-completedpage h1 {
    font-size: 2.2rem;
  }

  .agradecimiento {
    max-width: 100%;
  }

}

/*Mobile*/
@media (max-width: 480px) {

  #sp_6 .sd-body__page>.sd-page__row:not(:first-child) {
    padding-left: 30px;
    padding-right: 30px;
  }

  header {
    padding: 30px 30px 0 30px;
    flex-direction: column;
    gap: 2rem;
  }

  header .texto {
    width: 100%;
  }

  header .img {
    width: 100%;
    height: auto;
  }

  .sd-html h1,
  .sd-completedpage h1 {
    font-size: 2.2rem;
  }

  .sd-html h2 {
    font-size: 1.6rem;
  }


  .agradecimiento {
    max-width: 100%;
  }

  #sv-nav-start {
    padding: 0 30px 30px 30px;
  }
  
  .sd-body.sd-body--responsive .sd-body__navigation {
    flex-direction: column-reverse; /* next arriba, prev debajo */
    align-items: stretch;           /* opcional: que ocupen todo el ancho */
    gap: 10px;                      /* opcional: separación vertical */
  }
  
  #sv-nav-prev,
  #sv-nav-next {
    width: 100%;                    /* opcional: botones a ancho completo */
  }
}


#sp_15_content ul,
#sp_27_content ul,
#header ul {
  padding-inline-start: 0px;
}

#fontControls {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1000;
  background: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  font-family: system-ui, sans-serif;
}

#fontControls button {
  margin: 0 2px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}

#fontControls button[data-font="small"] { font-size: 16px; }
#fontControls button[data-font="normal"] { font-size: 18px; }
#fontControls button[data-font="large"] { font-size: 20px; }

#surveyElement .sd-root-modern,
#surveyElement .sd-root-modern p {
  font-size: 1em;
}

/* Dashboard Styles */
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background-color: var(--white);
  padding: 24px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.dashboard-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--cemcat-primary);
}

.dashboard-subtitle {
  margin-top: 6px;
  color: #6c757d;
}

.dashboard-info {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--cemcat-secondary);
  border-radius: 8px;
  border-left: 3px solid var(--cemcat-primary);
  font-size: 14px;
  color: var(--cemcat-text);
  font-weight: 500;
}

.progress-container {
  margin-top: 12px;
  max-width: 520px;
}

.progress-bar {
  height: 10px;
  background: #f1f3f5;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background: var(--cemcat-primary);
}

.progress-label {
  margin-top: 6px;
  color: #6c757d;
  font-size: 13px;
}

.dashboard-actions {
  flex: 0 0 auto;
}

.cemcat-btn-secondary {
  border: 1px solid #dee2e6;
  background: #fff;
  border-radius: 28px;
  padding: 12px 24px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease-in-out;
}

.cemcat-btn-secondary:hover {
  background: #f8f9fa;
  border-color: #ced4da;
}

.survey-list {
  margin-top: 20px;
}

.survey-list-item {
  background: white;
  border-radius: 14px;
  padding: 18px 24px;
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: all 0.2s ease-in-out;
}

.survey-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.survey-list-item.locked {
  opacity: 0.6;
  background: #f8f9fa;
}

.survey-details {
  min-width: 0;
}

.survey-title-container {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.survey-title {
  font-weight: 700;
  font-size: 18px;
  color: var(--cemcat-text);
}

.survey-id {
  color: #6c757d;
  font-size: 13px;
  margin-top: 6px;
}

.survey-actions {
  flex: 0 0 auto;
}

.cemcat-btn-primary {
  text-decoration: none;
  display: inline-block;
  border: none;
  border-radius: 28px;
  padding: 12px 24px;
  background: var(--cemcat-primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

.cemcat-btn-primary:hover {
  background: var(--primary-700);
}

.cemcat-btn-completed {
  background: #f0f0f0;
  color: #6c757d;
  cursor: pointer; /* Asegúrate de que el cursor sea un puntero */
}

.cemcat-btn-completed:hover {
  background: #e9ecef;
}

.status-badge-completed,
.status-badge-partial,
.status-badge-missing,
.status-badge-locked,
.status-badge-inactive {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge-completed {
  background: #e7f7ee;
  color: #0b6b2c;
}

.status-badge-partial {
  background: #fff3cd;
  color: #7a5b00;
}

.status-badge-missing {
    background: #f5e8d7;
    color: #de8615;
}

.status-badge-locked {
  background: #e9ecef;
  color: #6c757d;
}

.status-badge-inactive {
  background: #ffe3e3;
  color: #c92a2a;
}

.no-surveys-message {
  color: #6c757d;
  padding: 20px;
  text-align: center;
  background: #fff;
  border-radius: 14px;
}

.sd-body {
  padding: 24px;
}

/* Welcome Header */
.welcome-header {
  background-color: #fff;
  padding: 20px 20px 0px 20px;
  margin-bottom: 24px;
}

.welcome-header-container {
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.welcome-header-content {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex: 1;
}
.welcome-logo {
  max-width: 180px;
  flex-shrink: 0;
}
.welcome-text h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--cemcat-primary);
  margin-bottom: 8px;
  margin-top: 0;
}
.welcome-text p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--cemcat-text);
  margin-bottom: 0;
}
.welcome-image {
  flex-shrink: 0;
}
.welcome-image img {
  max-width: 260px;
  height: auto;
  border-radius: 8px;
}
@media (max-width: 768px) {
  .welcome-image {
    display: none;
  }

  .welcome-header-container {
    flex-direction: column;
    padding: 24px;
  }
  .welcome-header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

.info-section {
  background-color: var(--cemcat-secondary);
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}

.info-title {
  font-weight: 700;
  font-size: 18px;
  margin-top: 0;
  margin-bottom: 8px;
}

.info-subtitle {
  font-size: 15px;
  margin-top: 0;
  margin-bottom: 16px;
}

.info-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.info-items:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

/* Anula el comportamiento de lista dentro de los títulos de SurveyJS */
.sd-question__title ol, 
.sd-question__title li {
    display: inline;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sd-question__title li p {
    display: inline;
}

.sd-element--complex.sd-element--with-frame {
  padding-top: 40px;
}

/* Permitir clics en botones de encuestas completadas */
.cemcat-btn-completed {
    background: #f0f0f0;
    color: #6c757d;
    cursor: pointer; /* Cambiado para permitir clic */
    pointer-events: auto !important; /* Asegura que el clic funcione */
}

.cemcat-btn-completed:hover {
    background: var(--cemcat-secondary);
    color: var(--cemcat-primary);
}

/* Estilo para el mensaje de gracias en el listado */
.agradecimiento-dashboard {
    background-color: #ffffff;
    border: 2px solid var(--cemcat-primary);
    border-radius: 14px;
    padding: 30px;
    margin-bottom: 24px;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.img-thanks {
    max-width: 200px;
    margin-bottom: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
