/* Fondo oscuro a pantalla completa */
#issue-popup, #issue-success-popup {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 100;
}
#issue-success-popup { z-index: 101; }

/* Caja blanca centrada */
#issue-popup-box, #issue-success-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 520px;
  max-width: 92%;
  box-sizing: border-box;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
  color: #2e1313;
  font: 15px/1.4 'Helvetica Neue', Arial, sans-serif;
}

/* Cabecera: blanca, titulo centrado y separador */
#issue-popup-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 36px 24px 0;
  background: #fff;
}
#issue-popup-title {
  margin: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #ddd;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Cierre: circulo blanco con sombra, en la esquina superior izquierda, medio fuera de la caja */
#issue-popup-close {
  position: absolute;
  top: -18px;
  left: -18px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font: 24px/1 sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

/* Formulario */
#issue-form {
  padding: 8px 24px 28px;
}
#issue-form label {
  display: block;
  margin-top: 18px;
  font-weight: 600;
  font-size: 14px;
}
#issue-form select,
#issue-form textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 14px;
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
  color: inherit;
  font: inherit;
}
#issue-form select:focus,
#issue-form textarea:focus {
  outline: 0;
  border-color: #b90022;
  box-shadow: 0 0 0 1px #b90022;
}
#issue-form textarea {
  resize: vertical;
}

/* Selector de fichero: boton y texto propios (el campo nativo queda escondido pero accesible) */
.issue-file-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
#issue-form .issue-file-button {
  display: inline-block;
  margin: 0;
  padding: 10px 18px;
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}
#issue-form .issue-file-button:hover {
  background: #f3f3f3;
}
#issue-file-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  color: #555;
}
.issue-file-picker input[type=file] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

/* Botones: pildora centrada */
#issue-submit, #issue-success-close {
  display: block;
  width: 70%;
  margin: 28px auto 0;
  padding: 14px 18px;
  border: 0;
  border-radius: 28px;
  background: #b90022;
  color: #fff;
  font: 700 16px 'Helvetica Neue', Arial, sans-serif;
  cursor: pointer;
}
#issue-submit:hover, #issue-success-close:hover {
  background: #99001c;
}

/* Mensaje de exito */
#issue-success-box {
  padding: 36px 24px 28px;
  text-align: center;
}
#issue-success-box h1 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
}
#issue-success-box p {
  margin: 0;
}

/* Botones del popup de incidencia: Cancel (borde) y Report issue (relleno), lado a lado */
#issue-buttons {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}
#issue-buttons #issue-submit,
#issue-cancel {
  flex: 1;
  width: auto;
  margin: 0;
  padding: 14px 18px;
  border: 2px solid #b90022;
  border-radius: 28px;
  font: 700 16px 'Helvetica Neue', Arial, sans-serif;
  cursor: pointer;
}
#issue-buttons #issue-submit:hover { border-color: #99001c; }
#issue-cancel {
  background: #fff;
  color: #b90022;
}

#issue-cancel:hover { background: #fbeaed; }

/* Send deshabilitado (con Others, hasta tener comentario e imagen) y marca de campo obligatorio */
#issue-buttons #issue-submit:disabled { opacity: .45; cursor: not-allowed; }
#issue-buttons #issue-submit:disabled:hover { background: #b90022; border-color: #b90022; }
#issue-form label.required::after { content: ' *'; color: #b90022; }

@media (max-height: 600px) {
  #issue-buttons { margin-top: 16px; }
}

@media (max-height: 600px) {
  #issue-popup-box, #issue-success-box {
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #issue-popup-header {
    padding-top: 20px;
  }
  #issue-popup-title {
    padding-bottom: 10px;
    font-size: 16px;
  }
  #issue-popup-close {
    top: 6px;
    left: auto;
    right: 6px;
    box-shadow: none;
  }
  #issue-form {
    padding: 4px 16px 18px;
  }
  #issue-form label {
    margin-top: 10px;
  }
  #issue-form textarea {
    height: 64px;
  }
  #issue-submit {
    margin-top: 16px;
  }
}
